Reputation: 504
I got the following error when running the command to create a new postgres user. Any ideas what may have caused this - the error doesn't seem to be related to the create
bash command that I ran.
(sandbox) airflow@airflowvm:~/airflow$ airflow users create -u admin -p admin -r Admin -f admin -l admin -e [email protected]
Traceback (most recent call last):
File "/home/airflow/sandbox/bin/airflow", line 8, in <module>
sys.exit(main())
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/__main__.py", line 40, in main
args.func(args)
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/cli/cli_parser.py", line 47, in command
func = import_string(import_path)
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/utils/module_loading.py", line 32, in import_string
module = import_module(module_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/cli/commands/user_command.py", line 29, in <module>
from airflow.www.app import cached_app
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/www/app.py", line 38, in <module>
from airflow.www.extensions.init_views import (
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/www/extensions/init_views.py", line 29, in <module>
from airflow.www.views import lazy_add_provider_discovered_options_to_connection_form
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/www/views.py", line 2836, in <module>
class ConnectionFormWidget(FormWidget):
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/www/views.py", line 2839, in ConnectionFormWidget
field_behaviours = json.dumps(ProvidersManager().field_behaviours)
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/providers_manager.py", line 397, in field_behaviours
self.initialize_providers_manager()
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/providers_manager.py", line 129, in initialize_providers_manager
self._discover_all_providers_from_packages()
File "/home/airflow/sandbox/lib/python3.8/site-packages/airflow/providers_manager.py", line 149, in _discover_all_providers_from_packages
self._provider_schema_validator.validate(provider_info)
File "/home/airflow/sandbox/lib/python3.8/site-packages/jsonschema/validators.py", line 353, in validate
raise error
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('logo' was unexpected)
Failed validating 'additionalProperties' in schema['properties']['integrations']['items']:
{'additionalProperties': False,
'properties': {'external-doc-url': {'description': 'URL to external '
'documentation for '
'the integration.',
'type': 'string'},
'how-to-guide': {'description': 'List of paths to '
'how-to-guide for the '
'integration. The path '
'must start with '
"'/docs/'",
'items': {'type': 'string'},
'type': 'array'},
'integration-name': {'description': 'Name of the '
'integration.',
'type': 'string'},
'tags': {'description': 'List of tags describing the '
"integration. While we're "
'using RST, only one tag is '
'supported per integration.',
'items': {'enum': ['apache',
'aws',
'azure',
'gcp',
'gmp',
'google',
'protocol',
'service',
'software',
'yandex'],
'type': 'string'},
'maxItems': 1,
'minItems': 1,
'type': 'array'}},
'required': ['integration-name', 'external-doc-url', 'tags'],
'type': 'object'}
On instance['integrations'][0]:
{'external-doc-url': 'https://www.postgresql.org/',
'how-to-guide': ['/docs/apache-airflow-providers-postgres/operators/postgres_operator_howto_guide.rst'],
'integration-name': 'PostgreSQL',
'logo': '/integration-logos/postgres/Postgres.png',
'tags': ['software']}
Expected outpcome:
Admin user admin created
When I run the command, airflow db check
, I can connect successfully with INFO - Connection successful.
Upvotes: 0
Views: 294
Reputation: 20047
I believe you are using Airflow 2.0.0 with non-compatible Provider (likely forced when you installed it). Please upgrade Airflow to 2.1+ if you want to use Postgres Provider which has >= 2.1 limitation.
See comment in the changelog here: https://airflow.apache.org/docs/apache-airflow-providers-postgres/stable/index.html#id1
Upvotes: 1