{"record":{"id":"7162a566d2a33cde","repo":"puppetlabs/puppet","slug":"could-not-parse-filename-to-obtain-the-username-m","errorCode":null,"errorMessage":"Could not parse filename to obtain the username, module name and version.  (%{release_name})","messagePattern":"Could not parse filename to obtain the username, module name and version\\.  \\(%(.+?)\\)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/module_tool/applications/application.rb","lineNumber":80,"sourceCode":"\n        if File.file?(File.join(@path, 'Modulefile'))\n          Puppet.warning _(\"A Modulefile was found in the root directory of the module. This file will be ignored and can safely be removed.\")\n        end\n\n        @metadata\n      end\n\n      def load_metadata!\n        @metadata = nil\n        metadata(true)\n      end\n\n      def parse_filename(filename)\n        match = /^((.*?)-(.*?))-(\\d+\\.\\d+\\.\\d+.*?)$/.match(File.basename(filename, '.tar.gz'))\n        if match\n          module_name, author, shortname, version = match.captures\n        else\n          raise ArgumentError, _(\"Could not parse filename to obtain the username, module name and version.  (%{release_name})\") % { release_name: @release_name }\n        end\n\n        unless SemanticPuppet::Version.valid?(version)\n          raise ArgumentError, _(\"Invalid version format: %{version} (Semantic Versions are acceptable: http://semver.org)\") % { version: version }\n        end\n\n        {\n          :module_name => module_name,\n          :author => author,\n          :dir_name => shortname,\n          :version => version\n        }\n      end\n    end\n  end\nend\n","sourceCodeStart":62,"sourceCodeEnd":97,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/application.rb#L62-L97","documentation":"Application#parse_filename raises ArgumentError when a release tarball basename (minus .tar.gz) does not match /^((.*?)-(.*?))-(\\d+\\.\\d+\\.\\d+.*?)$/, the 'author-shortname-x.y.z...' shape used by Forge packages. The unpack/install pipeline relies on this to extract module name, author, and version, so a differently named archive is rejected before extraction.","triggerScenarios":"Passing a tarball like 'stdlib.tar.gz' (no author/version), 'puppetlabs-stdlib.tar.gz' (no version), 'mymodule-1.2.tar.gz' (two-part version), or a renamed download such as 'stdlib (1).tar.gz' to an application that parses release filenames (e.g. installing from a local file whose name was edited).","commonSituations":"Browser-appended ' (1)' duplication suffixes on re-downloads; manual repackaging with a custom name; internal mirrors renaming artifacts; scripts dropping the author prefix when saving.","solutions":["Rename the tarball to the canonical 'author-modulename-x.y.z-optional.tar.gz' form, e.g. 'puppetlabs-stdlib-9.0.0.tar.gz'.","Re-download the package from the Forge so the original filename is preserved.","If you built the package yourself, use `puppet module build` which names the pkg/ artifact correctly."],"exampleFix":"# before\npuppet module install ./stdlib-9.0.0.tar.gz   # missing author segment\n\n# after\npuppet module install ./puppetlabs-stdlib-9.0.0.tar.gz","handlingStrategy":"validation","validationCode":"RELEASE_NAME = /\\A(.+)-(\\d+\\.\\d+\\.\\d+.*)\\z/\n\nbasename = File.basename(tarball, '.tar.gz')\nabort \"rename to author-modulename-x.y.z.tar.gz\" unless RELEASE_NAME.match?(basename)","typeGuard":"def release_tarball?(filename)\n  File.basename(filename.to_s, '.tar.gz').match?(\\A.+\\-\\d+\\.\\d+\\.\\d+.*\\z) ? true : false\nend","tryCatchPattern":"begin\n  app.parse_filename(tarball)\nrescue ArgumentError => e\n  abort \"tarball name must be author-modulename-x.y.z.tar.gz\" if e.message.include?('Could not parse filename')\n  raise\nend","preventionTips":["Preserve the original filename when downloading Forge packages (avoid browser '(1)' suffixes).","Name internal packages with the author prefix and a full x.y.z version.","Build artifacts only via `puppet module build` which emits canonical names."],"tags":["puppet","module-tool","tarball","filename-validation"],"backgroundTag":"invalid-package-filename","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}