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
ERROR unable to initialize repository: unable to initialize repository: error opening repository: unable to open repository: invalid repository password #2370
Comments
I have the same issue too. Here's my compose file: services:
kopia:
container_name: kopia
image: kopia/kopia:unstable # using unstable as I want to use bash scripts for actions
command:
- server
- start
- --ui
- --insecure
- --disable-csrf-token-checks
- --address=0.0.0.0:51515
- --server-username=${KOPIA_USERNAME}@${KOPIA_HOSTNAME}
- --server-password=${KOPIA_PASSWORD}
- --enable-actions
user: "0:0"
domainname: ${KOPIA_USERNAME}
hostname: ${KOPIA_HOSTNAME}
networks:
main:
ports:
- "51515:51515"
environment:
TZ: Europe/London
USER: ${KOPIA_USERNAME}
KOPIA_PASSWORD: ${KOPIA_PASSWORD}
KOPIA_PERSIST_CREDENTIALS_ON_CONNECT: true
volumes:
# ! Base mounts
- ./volumes/kopia/config:/app/config
- ./.tmp/kopia:/app/cache
- ./volumes/kopia/logs:/app/logs
# ! Extra mounts
- ./scripts/pipes/kopia.pipe:/app/docker.pipe
- ./extra/scripts/kopia:/app/scripts
# ! Backup mounts
- ./secrets:/app/backup/secrets:ro
- ./volumes:/app/backup/volumes:ro
restart: unless-stopped Looking at After looking properly at my compose file again after pasting it here, I realised I had the wrong password in the |
I came here with the same issue, and this fixed it for me as well. |
Ok same thing seems to be the issue for me as well. But in my defense the entering repository password in the WebUI is a bit unintuitive. This is how it looks: since you are asked to enter the password and then confirm it, that step makes it seem like you are creating a new password specifically for that repository. BUT in reality what it is asking for is the same password you supplied to I'm also not sure why the repository password is asked in the first place during the UI setup, as you have already provided it via environment variable. |
Thanks, this was helpful in my setup.
I found it strange how the passwords are mapped. Then the |
I'm closing this one out as this was reported on Slack as having been addressed/answered. Please feel free to ping me or reopen if there is still an open question. |
This is a UX bug. Since there are multiple repositories, why do we only need to supply one password? |
Hello, I'm really struggling with all this. If anyone could help out that'd be much appreciated, it's driving me insane 🙃. I've picked up the default docker compose file here. When I start the container the first time, it's all good. If I boot it up for the first time, and restart it, it's all good.
I suspect I'm missing something with the But the env variables I'm tried so many configurations and nothing worked for me, it's a shame I'm quite desperate to switch to Kopia but this is really holding me back as I'm not able to make it work after a restart. Any help would be much appreciated. If that helps, my docker compose is like this:
Then:
|
Reopening this as there are folks still running into issues. |
Hi @maxime1992 You can ping me on slack and we will get this :-) Cheers, |
I was having this same issue and was able to get it working. Here are my steps:
Works (on my machine anyway) |
Hi @vmorganp, in general, "server-password" is used to provide a password to the basic authentification which you need to enter (see https://kopia.io/docs/reference/command-line/common/server-start/) The environment variable KOPIA_PASSWORD contains the password for the repository the docker container should connect to. One is used for the basic authentification, the other is used for the repository. Cheers, |
UPDATE 2: Scratch my previous update. This still works. My issue was with my password - I must have used a character that caused problems. I set everything up from scratch with a different password and now things work as they should.
This hint solved it for me! Once I set everything up fresh and used
I guess the environment variable only becomes relevant AFTER the repository has been set up in the web UI. Then, after a container restart, it is required to access the repository. Considering how many people are running into this issue, it should probably be documented better somewhere. A hint in the web UI to use the password from |
I was having the same issue but was able to solve it after checking the answers here. I believe the variable naming is confusing in the current description and examples. Here is how I have set it, to avoid confusion.
A .env file is also needed, with the actual values for all those variables. I also would like to ask if it is possible to run the docker without having to open a repository, or setting a password as a variable. I can see that when the docker runs for the first time, the web-server asks you to create or open an existing repository. Either way, this password MUST be used as the KOPIA_PASSWORD variable. I think it might be better if this password is stored in the configuration file in Kopia, after being created through the web (or access it if it's an existing one). If there's an error when trying to connect everytime the containers starts, it must promt to the same page as it was the first time running it. This might also help in cases when using different repositories, from the same server. In my case, I really don't mind having to access again the repository, from the web interface, everytime the container is started (as this usually won't happen unless an error with the server itself). |
I'm consistently get this error where first startup of kopia container works normally and I can setup B2 repo and syncing and everything else works fine, but the minute I restart the container I start getting this error in logs and container gets stuck in restart loop:
after that error, container restarts and gets the same error. And that loop continues indefinitely.
Happens with latest stable and unstable images.
Here is the docker-compose bit for kopia:
The text was updated successfully, but these errors were encountered: