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

Not able to install with docker-compose.yaml or docker pull #271

Open
treverehrfurth opened this issue Dec 12, 2023 · 4 comments
Open

Not able to install with docker-compose.yaml or docker pull #271

treverehrfurth opened this issue Dec 12, 2023 · 4 comments

Comments

@treverehrfurth
Copy link

I followed the install guide with the docker pull
docker pull ghcr.io/azimuttapp/azimutt:main

and docker run pointing to my .env.

It runs but I get this:

Setup Local file storage
Setup Local email provider
Setup Password auth
22:30:49.495 [error] Postgrex.Protocol (#PID<0.163.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
22:30:49.495 [error] Postgrex.Protocol (#PID<0.162.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
22:30:50.517 [error] Postgrex.Protocol (#PID<0.163.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
22:30:51.624 [error] Postgrex.Protocol (#PID<0.162.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
22:30:52.481 [error] Could not create schema migrations table. This error usually happens due to the following:
  * The database does not exist
  * The "schema_migrations" table, which Ecto uses for managing
    migrations, was defined by another library
  * There is a deadlock while migrating (such as using concurrent
    indexes with a migration_lock)
To fix the first issue, run "mix ecto.create" for the desired MIX_ENV.
To address the second, you can run "mix ecto.drop" followed by
"mix ecto.create", both for the desired MIX_ENV. Alternatively you may
configure Ecto to use another table and/or repository for managing
migrations:
    config :azimutt, Azimutt.Repo,
      migration_source: "some_other_table_for_schema_migrations",
      migration_repo: AnotherRepoForSchemaMigrations
The full error report is shown below.
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2991ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
  1. Ensuring your database is available and that you can connect to it
  2. Tracking down slow queries and making sure they are running fast enough
  3. Increasing the pool_size (although this increases resource consumption)
  4. Allowing requests to wait longer by increasing :queue_target and :queue_interval
See DBConnection.start_link/2 for more information
    (ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:913: Ecto.Adapters.SQL.raise_sql_call_error/1
    (elixir 1.14.3) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1005: Ecto.Adapters.SQL.execute_ddl/4
    (ecto_sql 3.10.1) lib/ecto/migrator.ex:738: Ecto.Migrator.verbose_schema_migration/3
    (ecto_sql 3.10.1) lib/ecto/migrator.ex:552: Ecto.Migrator.lock_for_migrations/4
    (ecto_sql 3.10.1) lib/ecto/migrator.ex:428: Ecto.Migrator.run/4
    (ecto_sql 3.10.1) lib/ecto/migrator.ex:170: Ecto.Migrator.with_repo/3
    nofile:1: (file)

I have not been able to fix it and the container just exits out.

I have also tried just using the docker-compose.yaml with this:

  GNU nano 6.2                                                                         docker-compose.yaml                                                                                  
services:
  database:
    image: postgres
    restart: always
    container_name: azimutt-db
    volumes:
      - /srv/dockerdata/azimutt/database:/var/lib/postgresql/data
    environment: # Used by the postgres image to setup a default user. For security reason, you should avoid using the postgres user
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: azimutt_dev
  backend:
    container_name: azimutt-backend
    platform: linux/amd64
    restart: always
    build:
      context: .
      dockerfile: Dockerfile
    depends_on:
      - database
    ports: # Docker need to expose ports for you to access your app.
      - 4000:4000
    env_file: .env
    environment:
      DATABASE_URL: "ecto://postgres:postgres@database/azimutt_dev" # Template : "ecto://db_user:db_password@ip_or_compose_service_name/db_name"
      SECRET_KEY_BASE: "secretkey" # Can literally be anything, but generally generated randomly by tools like mix phx.gen.secret

and this is the error I get:

failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount66378582/Dockerfile: no such file or directory

Am I just missing a ton or is there something seriously wrong?

@markus-ksg
Copy link

I'm in the same boat. The INSTALL.md seems to assume that users have a local postgres up and running and that they know how to create a database and tweak DATABASE_URL=postgresql://postgres:postgres@localhost/azimutt_dev for it to work.

If that's the case, then the installation steps should tell how to get a basic postgres setup running (probably just another local docker container plus some initialization commands).

I'd like to try Azimutt with an in-house database, but I'm not comfortable with sharing the whole schema with an online service.

@markus-ksg
Copy link

The "Pre-build Docker image" steps didn't work for me.
The "Build your own Docker image" worked when I removed the "export " prefixes in the .env file and replaced steps 3 and 4 with just

docker-compose up -d

The azimutt-backend then said:

[info] Running AzimuttWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
[info] Access AzimuttWeb.Endpoint at https://localhost

The right URL was http://localhost:4000

@treverehrfurth
Copy link
Author

Thank you!
I will give that a shot once I get some time to take another stab

@treverehrfurth
Copy link
Author

treverehrfurth commented Jan 8, 2024

Also, from a fellow paramotorist and snowboarder, hell yeah on the kite-wing skiing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants