# Repository Server

**URL:** <https://kopia.discourse.group/t/repository-server/28>\
**Category:** Support\
**Created:** [August 23, 2020, 5:32pm UTC](https://kopia.discourse.group/t/repository-server/28 "2020-08-23T17:32:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrankM](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/frankm/32/12_2.png) [@FrankM](https://kopia.discourse.group/u/FrankM)\
**Post date:** [August 23, 2020, 5:32pm UTC](https://kopia.discourse.group/t/repository-server/28/1 "2020-08-23T17:32:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [August 24, 2020, 5:00am UTC](https://kopia.discourse.group/t/repository-server/28/2 "2020-08-24T05:00:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![FrankM](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/frankm/32/12_2.png) [@FrankM](https://kopia.discourse.group/u/FrankM)\
**Post date:** [August 24, 2020, 2:45pm UTC](https://kopia.discourse.group/t/repository-server/28/3 "2020-08-24T14:45:20Z")

</div>

```
$ 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)
```

---

<div class="post-metadata">

**Author:** ![FrankM](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/frankm/32/12_2.png) [@FrankM](https://kopia.discourse.group/u/FrankM)\
**Post date:** [August 24, 2020, 4:43pm UTC](https://kopia.discourse.group/t/repository-server/28/4 "2020-08-24T16:43:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![FrankM](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/frankm/32/12_2.png) [@FrankM](https://kopia.discourse.group/u/FrankM)\
**Post date:** [August 24, 2020, 8:39pm UTC](https://kopia.discourse.group/t/repository-server/28/5 "2020-08-24T20:39:39Z")

</div>

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!**

---

<div class="post-metadata">

**Author:** ![FrankM](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/frankm/32/12_2.png) [@FrankM](https://kopia.discourse.group/u/FrankM)\
**Post date:** [August 25, 2020, 6:52pm UTC](https://kopia.discourse.group/t/repository-server/28/6 "2020-08-25T18:52:28Z")

</div>

I have created an issue

> <https://github.com/kopia/kopia/issues/557>
>
> When you connect to an repository server you get an error 405 when the URL end with an /
> wrong syntax
> USER@DOMAIN:~$ kopia...

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [September 2, 2020, 3:18am UTC](https://kopia.discourse.group/t/repository-server/28/7 "2020-09-02T03:18:11Z")

</div>

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