Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Fix Dockerfile importlib.metadata.PackageNotFoundError: fidesops [#23]#24

Closed
pattisdr wants to merge 1 commit into
ethyca:mainfrom
pattisdr:fidesops-23-fidesopsnotfound
Closed

Fix Dockerfile importlib.metadata.PackageNotFoundError: fidesops [#23]#24
pattisdr wants to merge 1 commit into
ethyca:mainfrom
pattisdr:fidesops-23-fidesopsnotfound

Conversation

@pattisdr
Copy link
Copy Markdown
Contributor

@pattisdr pattisdr commented Nov 2, 2021

Purpose

Fix fidesops not getting installed with make server:

fidesops    | Traceback (most recent call last):
fidesops    |   File "/usr/local/bin/fidesops", line 33, in <module>
fidesops    |     sys.exit(load_entry_point('fidesops', 'console_scripts', 'fidesops')())
fidesops    |   File "/usr/local/bin/fidesops", line 22, in importlib_load_entry_point
fidesops    |     for entry_point in distribution(dist_name).entry_points
fidesops    |   File "/usr/local/lib/python3.9/importlib/metadata.py", line 524, in distribution
fidesops    |     return Distribution.from_name(distribution_name)
fidesops    |   File "/usr/local/lib/python3.9/importlib/metadata.py", line 187, in from_name
fidesops    |     raise PackageNotFoundError(name)
fidesops    | importlib.metadata.PackageNotFoundError: fidesops

The culprit appears to be the bind mount in docker-compose.yml:

    fidesops:
      ...
      volumes:
        - type: bind
          source: ./
          target: /fidesops
          read_only: False

Changes

Set the working directory to fidesops after it installed. It seems like docker-compose is bind mounting a local directory to /fidesops which is useful for reloading, but then we can't find the package source when we're trying to install.

Ticket

Fixes #23

…docker-compose is bind mounting a volume to /fidesops, it is overriding the /fideops directory and my installed fidesops can't be found.
@pattisdr pattisdr changed the title Fix Dockerfile Fix Dockerfile importlib.metadata.PackageNotFoundError: fidesops Nov 2, 2021
@pattisdr pattisdr changed the title Fix Dockerfile importlib.metadata.PackageNotFoundError: fidesops Fix Dockerfile importlib.metadata.PackageNotFoundError: fidesops [#23] Nov 2, 2021
Copy link
Copy Markdown
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @pattisdr! 💯

@pattisdr
Copy link
Copy Markdown
Contributor Author

pattisdr commented Nov 8, 2021

Going to close, as I made this PR from my fork, which doesn't have CI enabled, and reopen -

@pattisdr pattisdr closed this Nov 8, 2021
@pattisdr
Copy link
Copy Markdown
Contributor Author

pattisdr commented Nov 8, 2021

Reopened here: #48

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix PackageNotFoundError: fidesops

3 participants