8000 Docker compose db_migration is missing gcp volume · Issue #1599 · diffgram/diffgram · GitHub
[go: up one dir, main page]

Skip to content

Docker compose db_migration is missing gcp volume #1599

@MathijsNL

Description

@MathijsNL

After running a fresh instance the container for the migration throws this error.

 docker logs diffgram-db_migration-1
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
[2024-04-02 20:15:20,695] ERROR data_tools_core_gcp.py Line 42: Error intializing GCP Client
ERROR [shared] Error intializing GCP Client
Traceback (most recent call last):
  File "/app/shared/data_tools_core_gcp.py", line 30, in __init__
    self.gcs = storage.Client(settings.GOOGLE_PROJECT_NAME)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/cloud/storage/client.py", line 121, in __init__
    super(Client, self).__init__(
  File "/usr/local/lib/python3.11/site-packages/google/cloud/client.py", line 319, in __init__
    Client.__init__(
  File "/usr/local/lib/python3.11/site-packages/google/cloud/client.py", line 178, in __init__
    credentials, _ = google.auth.default(scopes=scopes)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/auth/_default.py", line 459, in default
    credentials, project_id = checker()
                              ^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/auth/_default.py", line 221, in _get_explicit_environ_credentials
    credentials, project_id = load_credentials_from_file(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/auth/_default.py", line 107, in load_credentials_from_file
    raise exceptions.DefaultCredentialsError(
google.auth.exceptions.DefaultCredentialsError: File /gcp/gcp-service-account.json was not found.

It seems it is missing the volume:

  db_migration:
    image: diffgram/default:${DIFFGRAM_VERSION_TAG}
    env_file:
      - .env
    environment:
      PYTHONPATH: "/app/"
    command: ["/app/db-init.sh", "${DATABASE_HOST}"]
    depends_on:
      db:
        condition: service_healthy
      rabbitmq:
        condition: service_healthy
# The volume is currently missing
    volumes:
    - ${GCP_SERVICE_ACCOUNT_FILE_PATH}:/gcp/gcp-service-account.json

https://github.com/diffgram/diffgram/blob/master/docker-compose.yaml#L92-L103

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0