{"record":{"id":"7f054fa08a8b0a9b","repo":"ipfs/kubo","slug":"a-service-name-must-be-passed","errorCode":null,"errorMessage":"a service name must be passed","messagePattern":"a service name must be passed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/pin/remotepin.go","lineNumber":741,"sourceCode":"\nfunc (l PinServicesList) Len() int {\n\treturn len(l.RemoteServices)\n}\n\nfunc (l PinServicesList) Swap(i, j int) {\n\ts := l.RemoteServices\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (l PinServicesList) Less(i, j int) bool {\n\ts := l.RemoteServices\n\treturn s[i].Service < s[j].Service\n}\n\nfunc getRemotePinServiceFromRequest(req *cmds.Request, env cmds.Environment) (*pinclient.Client, error) {\n\tservice, serviceFound := req.Options[pinServiceNameOptionName]\n\tif !serviceFound {\n\t\treturn nil, fmt.Errorf(\"a service name must be passed\")\n\t}\n\n\tserviceStr := service.(string)\n\tvar err error\n\tc, err := getRemotePinService(env, serviceStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c, nil\n}\n\nfunc getRemotePinService(env cmds.Environment, name string) (*pinclient.Client, error) {\n\tif name == \"\" {\n\t\treturn nil, fmt.Errorf(\"remote pinning service name not specified\")\n\t}\n\tendpoint, key, err := getRemotePinServiceInfo(env, name)\n\tif err != nil {","sourceCodeStart":723,"sourceCodeEnd":759,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/pin/remotepin.go#L723-L759","documentation":"`getRemotePinServiceFromRequest` builds a client for a remote pinning service named via the `--service` option. If that option was not supplied on the command invocation (`pin remote ls/add/rm` paths that need the service), it cannot know which service to talk to and returns this error.","triggerScenarios":"Running `ipfs pin remote ls`, `add`, or `rm` operations without the `--service=<name>` option; or invoking the underlying command programmatically with `Options` missing the `pinServiceNameOptionName` key.","commonSituations":"Forgetting `--service` on `ipfs pin remote ls`; older tutorials/scripts that predate the required `--service` flag; wrapping the command in a tool that drops options.","solutions":["Add the `--service=<name>` option: e.g. `ipfs pin remote ls --service=web3.storage`.","Confirm the service is registered (`ipfs pin remote service ls` or config `Pinning.RemoteServices`) and use its exact name.","Fix wrappers/automation to always pass `--service`; consult `ipfs pin remote <subcmd> --help` for the option name in your version."],"exampleFix":"// before\nipfs pin remote ls\n// after\nipfs pin remote ls --service=web3.storage","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n: \"${SERVICE:?--service is required}\"\nipfs pin remote ls --service=\"${SERVICE}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make --service a mandatory parameter in wrapper scripts","List registered services first to pick a valid name","Never rely on a default service name existing"],"tags":["cli","remote-pinning","missing-option","argument-validation"],"backgroundTag":"missing-required-option","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}