Repository Server

Hello,

i have successfully set up a Kopia repository server 0.6.3 and can create snapshots via CLI.

For this I connect to the server with

kopia repo connect server --url=https://DOMAIN:51515/ --override-username=USER --override-hostname=DOMAIN

After this, i do

kopia snapshot create $HOME

Now I have clicked the button Disconnect in the WebUI during testing. OK, reconnect to it.
Now in WebUI all is fine, but i can’t connect via CLI. I got this error

kopia: error: server error: 405 Method Not Allowed, try --help

I rebooted the server, rebooted my PC. No matter what I do, the error remains. How can I solve the problem?

Web UI and CLI share the same configuration files. When you do ‘repo connect’ in CLI it creates repository.config file which persists the location of the repository. When you connect to repo in Web UI does exactly the same thing.

When you click Disconnect it removes configuration file (it’s equivalent to kopia repo disconnect).

On the CLI it may be helpful to:

  1. Verify that you’re connected to the repository you think you should be connected to (kopia repo status)

  2. Enable logging (–log-level=debug should to it) to understand what it’s trying to do when connecting.

Let me know if this helps at all.

$ kopia repo status
kopia: error: unable to close repository: server error: 405 Method Not Allowed, try --help

In log i don’t find anything

2020-08-24 18:01:05.420 D [server.go:117] request /api/v1/sources (0 bytes)
2020-08-24 18:01:08.419 D [server.go:117] request /api/v1/sources (0 bytes)
2020-08-24 18:01:11.420 D [server.go:117] request /api/v1/sources (0 bytes)
2020-08-24 18:01:14.420 D [server.go:117] request /api/v1/sources (0 bytes)
2020-08-24 18:01:14.835 D [content_manager.go:644] Refresh started
2020-08-24 18:01:14.835 D [list_cache.go:32] retrieved list of 0 'm' index blobs from cache
2020-08-24 18:01:14.835 D [content_manager_own_writes.go:168] merged [] backend blobs and [] local blobs into []
2020-08-24 18:01:14.835 D [list_cache.go:32] retrieved list of 3 'n' index blobs from cache
2020-08-24 18:01:14.835 D [content_manager_own_writes.go:168] merged [{n7e62f145e15e2ae9e01b0397eb98831e 147989 2020-08-24 17:22:05.249856514 +0200 CEST} {ndb4ad2e89be348539dd$
2020-08-24 18:01:14.835 D [content_manager_lock_free.go:200] index blob "ndb4ad2e89be348539dd9785690ed6316" already in cache, skipping
2020-08-24 18:01:14.835 D [content_manager_lock_free.go:200] index blob "ne7c8ca18c765c19d273851d81a4e7f39" already in cache, skipping
2020-08-24 18:01:14.835 D [content_manager_lock_free.go:200] index blob "n7e62f145e15e2ae9e01b0397eb98831e" already in cache, skipping
2020-08-24 18:01:14.835 D [content_manager.go:649] Refresh completed in 268.51µs and updated=false
2020-08-24 18:01:15.565 D [server.go:117] request /api/v1/repo/parameters (0 bytes)
2020-08-24 18:01:17.420 D [server.go:117] request /api/v1/sources (0 bytes)

What is the difference if I connect the server with my browser or via CLI from a remote computer?

Everything works fine with the browser.
With CLI I get 405 error. Different users tried, different computers, the problem must be with the server. But unfortunately I have no idea what is wrong.

Ok found the problem.

wrong syntax

USER@DOMAIN:~$ kopia repo connect server --url=https://DOMAIN:51515/ --override-username=USER --override-hostname=DOMAIN
Enter password to open repository: 

kopia: error: server error: 405 Method Not Allowed, try --help

correct syntax

USER@DOMAIN:~$ kopia repo connect server --url=https://DOMAIN:51515 --override-username=USER --override-hostname=DOMAIN
Enter password to open repository: 

Connected to repository API Server.

NOTICE: Kopia will check for updates on GitHub every 7 days, starting 24 hours after first use.
To disable this behavior, set environment variable KOPIA_CHECK_FOR_UPDATES=false
Alternatively you can remove the file "/home/frank/.config/kopia/repository.config.update-info.json".

This little sign / makes this URL false. So we get an 405 error. I think we can check for an correct URL in the code. But i am no coder, so someone else has to do it.

Problem solved!

I have created an issue

1 Like

FYI - this has been fixed in latest code and will be available in v0.7.0 release in couple weeks.

1 Like