{"record":{"id":"b56b4587cc6d7aa3","repo":"ipfs/kubo","slug":"invalid-ipns-name-w","errorCode":null,"errorMessage":"invalid IPNS name: %w","messagePattern":"invalid IPNS name: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/name/name.go","lineNumber":473,"sourceCode":"\t\t\t}\n\t\t\tdelegatedPublishers := cfg.DelegatedPublishersWithAutoConf()\n\t\t\tif len(delegatedPublishers) == 0 {\n\t\t\t\treturn errors.New(\"no delegated publishers configured: add Ipns.DelegatedPublishers or use --allow-offline for local-only publishing\")\n\t\t\t}\n\t\t\t// For allow-delegated mode, we proceed even if offline\n\t\t\t// since we're using HTTP publishing via delegated publishers\n\t\t}\n\n\t\t// Parse the IPNS name argument\n\t\tnameArg := req.Arguments[0]\n\t\tif !strings.HasPrefix(nameArg, \"/ipns/\") {\n\t\t\tnameArg = \"/ipns/\" + nameArg\n\t\t}\n\t\t// Extract the name part after /ipns/\n\t\tnamePart := strings.TrimPrefix(nameArg, \"/ipns/\")\n\t\tname, err := ipns.NameFromString(namePart)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid IPNS name: %w\", err)\n\t\t}\n\n\t\t// Read raw record bytes from file/stdin\n\t\tfile, err := cmdenv.GetFileArg(req.Files.Entries())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer file.Close()\n\n\t\t// Read record data (limit to 1 MiB for memory safety)\n\t\tdata, err := io.ReadAll(io.LimitReader(file, 1<<20))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to read record: %w\", err)\n\t\t}\n\t\tif len(data) == 0 {\n\t\t\treturn errors.New(\"record is empty\")\n\t\t}\n","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/name/name.go#L455-L491","documentation":"`ipfs ipns put` parses the given name argument with ipns.NameFromString after stripping the /ipns/ prefix. If the remaining string is not a valid IPNS name (expected to be a peer ID / public key form), the command wraps the parse error with this message.","triggerScenarios":"`ipfs ipns put <name> ...` where <name> is not a valid libp2p public-key-based IPNS name — malformed peer ID, wrong multihash/multibase, or a path like /ipns/example.com that is a DNSLink name rather than a key name.","commonSituations":"Passing a DNS name (DNSLink) to ipns put, a typo'd or truncated peer ID, or a CID-based name that the ipns.Name parser does not accept.","solutions":["Pass the exact peer ID (public key) name the record was signed for, e.g. 12D3KooW... or its /ipns/ form","Verify the name with `ipfs key list` or `ipfs id` and copy it unmodified","If targeting a DNSLink name, note that ipns put requires a key-based name"],"exampleFix":"// before\nipfs ipns put /ipns/mydomain.example record.bin\n// error: invalid IPNS name: ...\n// after\nipfs ipns put /ipns/12D3KooWExamplePeerID... record.bin","handlingStrategy":"validation","validationCode":"namePart := strings.TrimPrefix(arg, \"/ipns/\")\nif _, err := ipns.NameFromString(namePart); err != nil {\n    return fmt.Errorf(\"not a valid key-based IPNS name: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if _, err := ipns.NameFromString(strings.TrimPrefix(arg, \"/ipns/\")); err != nil {\n    // surface a clear message: DNSLink names are not accepted by ipns put\n}","preventionTips":["Copy peer IDs unmodified from `ipfs key list` or `ipfs id`","Do not pass DNSLink/DNS names to ipns put"],"tags":["ipns","validation","peer-id"],"backgroundTag":"invalid-ipns-name","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"}