{"record":{"id":"48941e8d33b2cd09","repo":"cloudflare/cloudflared","slug":"no-gpg-keys-were-provided-for-signing","errorCode":null,"errorMessage":"No GPG keys were provided for signing","messagePattern":"No GPG keys were provided for signing","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"release_pkgs.py","lineNumber":423,"sourceCode":"\n\nif __name__ == \"__main__\":\n    try:\n        args = parse_args()\n    except Exception as e:\n        logging.exception(e)\n        exit(1)\n\n    pkg_creator = PkgCreator()\n    # Import one or two keypairs; primary first\n    key_results = pkg_creator.import_multiple_gpg_keys(\n        args.gpg_private_key,\n        args.gpg_public_key,\n        args.gpg_private_key_2,\n        args.gpg_public_key_2,\n    )\n    if not key_results or len(key_results) == 0:\n        raise SystemExit(\"No GPG keys were provided for signing\")\n    primary_gpg_key_id, primary_gpg_key_name = key_results[0]\n    secondary_gpg_key_id = None\n    secondary_gpg_key_name = None\n    if len(key_results) > 1:\n        secondary_gpg_key_id, secondary_gpg_key_name = key_results[1]\n\n    if args.gpg_private_key_2:\n        print(f\"signing RPM with secondary gpg_key: {secondary_gpg_key_id}\")\n        pkg_creator.import_rpm_key(args.gpg_public_key_2)\n    else:\n        print(f\"signing RPM with primary gpg_key: {primary_gpg_key_name}\")\n        pkg_creator.import_rpm_key(args.gpg_public_key)\n\n\n    pkg_uploader = PkgUploader(args.account, args.bucket, args.id, args.secret)\n    print(f\"signing deb with primary gpg_key: {primary_gpg_key_id} and secondary gpg_key: {secondary_gpg_key_id}\")\n    create_deb_packaging(\n        pkg_creator,","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/release_pkgs.py#L405-L441","documentation":"The main flow calls import_multiple_gpg_keys and, if the returned list is empty, raises SystemExit('No GPG keys were provided for signing') to abort before any signing step. It indicates the CLI arguments for GPG keys resolved to nothing usable. Because it is SystemExit, it terminates the process with the message rather than a traceback.","triggerScenarios":"Running the script without any of --gpg-private-key/--gpg-public-key (and the optional secondary pair) so import_multiple_gpg_keys returns [], or all provided key values are empty strings filtered out upstream.","commonSituations":"CI workflows where the GPG key secrets were not injected (empty env vars), the argument parsing maps missing flags to None and the importer silently skips them, or a misconfigured job matrix omitting the signing inputs.","solutions":["Provide the primary GPG private/public key pair via --gpg-private-key and --gpg-public-key (base64-encoded).","Check that the CI secrets backing the flags are set and non-empty at runtime.","Fail earlier with an argparse-required argument or explicit validation so the message includes which flags are missing.","If signing is optional, add a flag to skip signing instead of passing empty key values."],"exampleFix":"// before\nparser.add_argument(\"--gpg-private-key\")\n// after\nparser.add_argument(\"--gpg-private-key\", required=True, help=\"base64-encoded GPG private key\")","handlingStrategy":"validation","validationCode":"if not (args.gpg_private_key and args.gpg_public_key):\n    parser.error(\"--gpg-private-key and --gpg-public-key are required for signing\")","typeGuard":null,"tryCatchPattern":"try:\n    key_results = import_multiple_gpg_keys(priv, pub, priv2, pub2)\nexcept SystemExit as e:\n    logging.error(\"signing setup aborted: %s\", e)\n    raise","preventionTips":["Mark signing flags required in argparse so missing keys fail with a clear message","Check CI secret injection (empty env vars are the usual cause)","Optionally add a --no-sign flag for unsigned release runs instead of empty keys"],"tags":["gpg","cli","signing","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}