Connect server not picking up credential file location from docker-compose?

Options
hamza
hamza
Community Member

Hi,

this is probably me doing something daft but I have the following docker-compose.yaml (adapted from your example file as per here: https://developer.1password.com/docs/connect/get-started/#get-help)

version: "3.4"

services:
op-connect-api:
image: 1password/connect-api:latest
ports:
- "8080:8080"
volumes:
- "./1password-credentials.json:/home/hmxadmin/1pass/1password-credentials.json"
- "data:/home/hmxadmin/1pass/data"
op-connect-sync:
image: 1password/connect-sync:latest
ports:
- "8081:8080"
volumes:
- "./1password-credentials.json:/home/hmxadmin/1pass/1password-credentials.json"
- "data:/home/hmxadmin/1pass/data"

volumes:
data:

I have changed the location of the 1password-credentials.json file (as per your documentation) in the docker-compose.

The filesystem looks like this:

hmxadmin@1pass:~/1pass$ pwd
/home/hmxadmin/1pass
hmxadmin@1pass:~/1pass$ ls -l
total 8
-r--r--r-- 1 hmxadmin hmxadmin 1094 Mar 31 15:50 1password-credentials.json
-rw-rw-r-- 1 hmxadmin hmxadmin 506 Mar 31 15:59 docker-compose.yml
hmxadmin@1pass:~/1pass$

However on starting the docker container with sudo docker-compose up i get the following error:

op-connect-api_1 | {"log_message":"(I) no database found, will retry in 1s","timestamp":"2023-03-31T17:07:32.221266583Z","level":3}
op-connect-sync_1 | {"log_message":"(I) database initialization complete","timestamp":"2023-03-31T17:07:32.18024019Z","level":3}
op-connect-sync_1 | {"log_message":"(I) ### syncer credentials bootstrap ### ","timestamp":"2023-03-31T17:07:32.180484581Z","level":3}
op-connect-sync_1 | {"log_message":"(I) starting 1Password Connect Sync ...","timestamp":"2023-03-31T17:07:32.180571396Z","level":3}
op-connect-sync_1 | {"log_message":"(E) Server: (unable to get credentials and initialize API, retrying in 500ms), Wrapped: (failed to FindCredentialsUniqueKey), Wrapped: (failed to loadCredentialsFile), Wrapped: (LoadLocalAuthV2 failed to credentialsDataFromDisk), open /home/opuser/.op/1password-credentials.json: no such file or directory","timestamp":"2023-03-31T17:07:32.180609711Z","level":1}

which appears to be referencing the default /example location of /home/opuser/.op/1password-credentials.json still. Which I don't think I have anywhere on my machine.

This is running on a new VM running ubuntu server 22.04 LTS. Spun today and installed docker and docker-compose. Nothing else.

What am I doing wrong?

Thanks for the assistance.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided

Comments

  • hamza
    hamza
    Community Member
    Options

    Please ignore. I see my daft mistake. i had the host/ container volume syntax the wrong way around

  • Thanks for the update, glad you were able to get things working! :)

This discussion has been closed.