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

Airflow v2.0.0b1 package doesnt include "api_connexion/exceptions" #12239

Closed
anirudhbagri opened this issue Nov 10, 2020 · 31 comments · Fixed by #12240
Closed

Airflow v2.0.0b1 package doesnt include "api_connexion/exceptions" #12239

anirudhbagri opened this issue Nov 10, 2020 · 31 comments · Fixed by #12240
Labels
kind:bug This is a clearly a bug

Comments

@anirudhbagri
Copy link
Contributor

anirudhbagri commented Nov 10, 2020

Apache Airflow version: 2.0.0b1

Kubernetes version (if you are using kubernetes) (use kubectl version): NA

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): macOS
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:
Installed apache-airlfow==2.0.0b1 using pip.
Running airflow webserver gave the following error:

Traceback (most recent call last):
  File "/Users/abagri/Workspace/service-workflows/venv/bin/airflow", line 8, in <module>
    sys.exit(main())
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.8/site-packages/airflow/__main__.py", line 40, in main
    args.func(args)
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.8/site-packages/airflow/cli/cli_parser.py", line 49, in command
    func = import_string(import_path)
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.8/site-packages/airflow/utils/module_loading.py", line 32, in import_string
    module = import_module(module_path)
  File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/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 "/Users/abagri/Workspace/service-workflows/venv/lib/python3.8/site-packages/airflow/cli/commands/webserver_command.py", line 43, in <module>
    from airflow.www.app import cached_app, create_app
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.8/site-packages/airflow/www/app.py", line 39, in <module>
    from airflow.www.extensions.init_views import (
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.8/site-packages/airflow/www/extensions/init_views.py", line 25, in <module>
    from airflow.api_connexion.exceptions import common_error_handler
ModuleNotFoundError: No module named 'airflow.api_connexion.exceptions'

What you expected to happen:
Expect this command to start the webserver

How to reproduce it:
Install a fresh version of airflow, run airflow db init followed by airflow webserver

Anything else we need to know:

@anirudhbagri anirudhbagri added the kind:bug This is a clearly a bug label Nov 10, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 10, 2020

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

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

cc: @ashb @kaxil -> looking at it

@anirudhbagri
Copy link
Contributor Author

anirudhbagri commented Nov 10, 2020

I downloaded the packages externally from here, this one also doesn't contain anything except the openapi folder.

@kaxil
Copy link
Member

kaxil commented Nov 10, 2020

I downloaded the packages externally from here, this one also doesn't contain anything except the openapi folder.

What command did you run? pip install apache-airflow==2.0.0b1 or did you download the tar.gz and run pip install FILEPATH_TO_TAR

@anirudhbagri
Copy link
Contributor Author

anirudhbagri commented Nov 10, 2020

I first ran pip install apache-airflow==2.0.0b1 and ran the command (airflow webserver) to get those errors.

Then to confirm, I downloaded the tar to check the contents. (didn't install the tar)

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

@ashb @kaxil -> indeed the problem is with implicit packages. The root cause is that api_connexion has no __init__.py

@kaxil
Copy link
Member

kaxil commented Nov 10, 2020

aah, we just need to add __init__.py file then, wonder why and how it got deleted / missing

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

It was never there - but the change with implicit packages, changed find_namespace_packages into find_packages in setup.py and now setup.py simply does not find the package.

@kaxil
Copy link
Member

kaxil commented Nov 10, 2020

It was there, it got renamed here: b2a28d1 / #12082

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

AAAAAH Github rebase magic finding wrong files!

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

Bad me!

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

Sounds like b2 then

@ashb
Copy link
Member

ashb commented Nov 10, 2020

@potiuk https://github.com/apache/airflow/pull/12082/files#r518885540

You also resolved this discussion of mine. This file rename was the cause of that problem.

@kaxil
Copy link
Member

kaxil commented Nov 10, 2020

Yeah, let's cut out beta2 today itself

@anirudhbagri
Copy link
Contributor Author

b2? :(

@ashb
Copy link
Member

ashb commented Nov 10, 2020

Fix coming.

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

@potiuk https://github.com/apache/airflow/pull/12082/files#r518885540

You also resolved this discussion of mine. This file rename was the cause of that problem.

Yep. Entirely my fault if we are looking for the blame.

@ashb
Copy link
Member

ashb commented Nov 10, 2020

I missed it too! It happens, we're just unlucky in the timing

ashb added a commit to astronomer/airflow that referenced this issue Nov 10, 2020
A bad rebase in apache#12082 deleted this file by mistake.

This missing file was also the cause of needing the documentation
to exclude these files

Fixes apache#12239
@kaxil
Copy link
Member

kaxil commented Nov 10, 2020

None of our tests caught it :(

@ashb
Copy link
Member

ashb commented Nov 10, 2020

Our tests almost entirely operate on an "editable" install is why :(

@ashb
Copy link
Member

ashb commented Nov 10, 2020

I'm going to rename Beta2 milestone to Beta3 (etc).

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

Our tests almost entirely operate on an "editable" install is why :(

That's the next step we discussed with Ash that production image should also be build using packages/wheels. I will add it before next beta. it will be rather impossible for CI, but since we have k8s test using the production image and it uses both - scheduler and webserver it will be a very good test.

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

I also merged #12231 and will double test it now - also we can release sendgrid 1.0.0b2

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

The extras work perfectly from local installation now.

@potiuk
Copy link
Member

potiuk commented Nov 10, 2020

pip install ".[kubernetes]"

...

Collecting apache-airflow-providers-cncf-kubernetes; extra == "kubernetes"
  Downloading apache_airflow_providers_cncf_kubernetes-1.0.0b1-py3-none-any.whl (32 kB)
...

@ashb
Copy link
Member

ashb commented Nov 10, 2020

Sendgrid we can do as a 1.0.0b1 on it's own. I'll do that right now.

@anirudhbagri
Copy link
Contributor Author

Although I get that __init__.py file was not present in the folder, why did openapi folder got into the package?
was it because openapi did not have __init__.py whereas endpoints and schema had __init__.py inside them?

@ashb
Copy link
Member

ashb commented Nov 10, 2020

apache-airflow-2.0.0b1/airflow/api_connexion/
apache-airflow-2.0.0b1/airflow/api_connexion/openapi/
apache-airflow-2.0.0b1/airflow/api_connexion/openapi/v1.yaml

That is there because datafiles are included via a different mechanism to code files.

@kaxil
Copy link
Member

kaxil commented Nov 10, 2020

Yeah we include openapi files:

include airflow/api_connexion/openapi/v1.yaml

'airflow.api_connexion.openapi': ['*.yaml'],

@anirudhbagri
Copy link
Contributor Author

anirudhbagri commented Nov 10, 2020

Oh, Got it. 👍🏻 Thank you!

kaxil pushed a commit that referenced this issue Nov 10, 2020
A bad rebase in #12082 deleted this file by mistake.

This missing file was also the cause of needing the documentation
to exclude these files

Fixes #12239
@ashb
Copy link
Member

ashb commented Nov 10, 2020

Beta 2 had been pushed to pypi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants