Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Airflow in Dockerfile is not creating the database #15502

Closed
brunojus opened this issue Apr 23, 2021 · 3 comments
Closed

Error Airflow in Dockerfile is not creating the database #15502

brunojus opened this issue Apr 23, 2021 · 3 comments
Labels
invalid kind:bug This is a clearly a bug

Comments

@brunojus
Copy link

I am getting the error below when I am running the Airflow with docker-compose in a Macos/Windows environment.

> webserver_1  | [2021-04-23 07:30:27,971] {abstract.py:229} ERROR -
> Failed to add operation for GET /api/v1/connections webserver_1  |
> Traceback (most recent call last): webserver_1  |   File
> "/usr/local/lib/python3.7/site-packages/connexion/apis/abstract.py",
> line 209, in add_paths webserver_1  |     self.add_operation(path,
> method) webserver_1  |   File
> "/usr/local/lib/python3.7/site-packages/connexion/apis/abstract.py",
> line 173, in add_operation webserver_1  |    
> pass_context_arg_name=self.pass_context_arg_name webserver_1  |   File
> "/usr/local/lib/python3.7/site-packages/connexion/operations/__init__.py",
> line 8, in make_operation webserver_1  |     return
> spec.operation_cls.from_spec(spec, *args, **kwargs) webserver_1  |  
> File
> "/usr/local/lib/python3.7/site-packages/connexion/operations/openapi.py",
> line 138, in from_spec webserver_1  |     **kwargs webserver_1  |  
> File
> "/usr/local/lib/python3.7/site-packages/connexion/operations/openapi.py",
> line 89, in __init__ webserver_1  |    
> pass_context_arg_name=pass_context_arg_name webserver_1  |   File
> "/usr/local/lib/python3.7/site-packages/connexion/operations/abstract.py",
> line 96, in __init__ webserver_1  |     self._resolution =
> resolver.resolve(self) webserver_1  |   File
> "/usr/local/lib/python3.7/site-packages/connexion/resolver.py", line
> 40, in resolve webserver_1  |     return
> Resolution(self.resolve_function_from_operation_id(operation_id),
> operation_id) webserver_1  |   File
> "/usr/local/lib/python3.7/site-packages/connexion/resolver.py", line
> 66, in resolve_function_from_operation_id webserver_1  |     raise
> ResolverError(str(e), sys.exc_info()) webserver_1  |
> connexion.exceptions.ResolverError: <ResolverError: columns>

1

Apache Airflow version: 2.0.1

Environment:

  • OS (e.g. from /etc/os-release): Windows/Macos
  • Install tools: Docker
@brunojus brunojus added the kind:bug This is a clearly a bug label Apr 23, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 23, 2021

Thanks for opening your first issue here! Be sure to follow the issue template!

@marcosmarxm
Copy link
Contributor

Hi @brunojus installing Airflow in MacOS/Windows sometimes can be more difficult. There are some issues/contributions to help users on that. Can you look #14231

@potiuk potiuk added the invalid label Apr 24, 2021
@potiuk
Copy link
Member

potiuk commented Apr 24, 2021

Closing this as invalid. There is no information about how you are running this and what docker-compose you use. The Dockerfile is not supposed to create a database, docker image is only there to run the software.

If you have an external DB, you need to create airflow DB using some kind of init container. With Docker-compose you could create an init-service that could do it. There are examples in https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html where you can see an example docker compose that uses external database and creates it for "production" settings where database is external and it initializes the DB and creates the admin user.

If you just want to use "sqlite" embeded database for a "really quick start" (not production - it's not supposed to be used in production) in the docker image you have the environment variable _AIRFLOW_DB_UPGRADE that you can use to create/upgrade the schema as described here: https://airflow.apache.org/docs/docker-stack/entrypoint.html#upgrading-airflow-db (also next chapters show you how to create the user) but this is really for "local development" purpose and it should never be used in production, that's why all those variables start with _ because they are dev-only.

@potiuk potiuk closed this as completed Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

3 participants