Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-6164

airflow connections add fails if spaces are present in conn_extra argument

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.10.6
    • Fix Version/s: None
    • Component/s: webserver
    • Labels:
      None

      Description

      When creating a new connection from cli:

      airflow connections -a --conn_id test1 --conn_type google_cloud_platform --conn_extra '{"extra__jdbc__drv_path": "", "extra__jdbc__drv_clsname": "", "extra__google_cloud_platform__project": "my-project", "extra__google_cloud_platform__key_path": "", "extra__google_cloud_platform__keyfile_dict": "{     \\"auth_provider_x509_cert_url\\": \\"https://www.googleapis.com/oauth2/v1/certs\\",     \\"auth_uri\\": \\"https://accounts.google.com/o/oauth2/auth\\",     \\"client_email\\": \\"email@com\\",     \\"client_id\\": \\"123456\\",     \\"client_x509_cert_url\\": \\"https://www.googleapis.com/robot/v1/metadata/x509/blahblah\\",     \\"private_key\\": \\"-----BEGIN PRIVATE KEY-----\\\\nMI0yM8=\\\\n-----END PRIVATE KEY-----\\\\n\\",     \\"private_key_id\\": \\"123456789\\",     \\"project_id\\": \\"my_project\\",     \\"token_uri\\": \\"https://oauth2.googleapis.com/token\\",     \\"type\\": \\"service_account\\" }", "extra__google_cloud_platform__scope": "", "extra__google_cloud_platform__num_retries": 5, "extra__grpc__auth_type": "", "extra__grpc__credential_pem_file": "", "extra__grpc__scopes": ""}'
      

      or even

      airflow connections -a --conn_id test2 --conn_type google_cloud_platform --conn_extra '{"asd asd":"sdf"}'
      

      it fails with

      airflow-1-10: error: unrecognized arguments: "", "extra__jdbc__drv_clsname": "", "extra__google_cloud_platform__project": "my-project", "extra__google_cloud_platform__key_path": "", "extra__google_cloud_platform__keyfile_dict": "{ \\"auth_provider_x509_cert_url\\": \\"https://www.googleapis.com/oauth2/v1/certs\\", \\"auth_uri\\": \\"https://accounts.google.com/o/oauth2/auth\\", \\"client_email\\": \\"email@com\\", \\"client_id\\": \\"123456\\", \\"client_x509_cert_url\\": \\"https://www.googleapis.com/robot/v1/metadata/x509/blahblah\\", \\"private_key\\": \\"-----BEGIN PRIVATE KEY-----\\\\nMI0yM8=\\\\n-----END PRIVATE KEY-----\\\\n\\", \\"private_key_id\\": \\"123456789\\", \\"project_id\\": \\"my_project\\", \\"token_uri\\": \\"https://oauth2.googleapis.com/token\\", \\"type\\": \\"service_account\\" }", "extra__google_cloud_platform__scope": "", "extra__google_cloud_platform__num_retries": 5, "extra__grpc__auth_type": "", "extra__grpc__credential_pem_file": "", "extra__grpc__scopes": ""}
      
      

      or

      airflow-1-10: error: unrecognized arguments: asd":"sdf"}
      

      accordingly.

      The same commands works perfect in airflow 1.10.2.

      I'm not sure in which version this was broken.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Levandovsky Mikhail
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: