# Trouble ogging in and cloning repositories to self-hosted Onedev instance behind Traefik

**URL:** https://community.traefik.io/t/trouble-ogging-in-and-cloning-repositories-to-self-hosted-onedev-instance-behind-traefik/23950
**Category:** Traefik v3 (latest)
**Tags:** docker, tcp
**Created:** [August 9, 2024, 12:34pm UTC](https://community.traefik.io/t/trouble-ogging-in-and-cloning-repositories-to-self-hosted-onedev-instance-behind-traefik/23950 "2024-08-09T12:34:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![innomatrix](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/innomatrix/32/9164_2.png) [@innomatrix](https://community.traefik.io/u/innomatrix)
#### Post date: [August 9, 2024, 12:34pm UTC](https://community.traefik.io/t/trouble-ogging-in-and-cloning-repositories-to-self-hosted-onedev-instance-behind-traefik/23950/1 "2024-08-09T12:34:38Z")

</div>

I'm having trouble logging in with Docker from the terminal nor cloning repositories from my self-hosted onedev instance that is deployed behind a Traefik reverse proxy.

The onedev server is running in a Docker container with the following Docker Compose configuration:

```docker
services:
  app:
    hostname: 'onedev'
    image: '1dev/server:latest'
    container_name: 'onedev-app'
    restart: unless-stopped
    environment:
      - hibernate_dialect=io.onedev.server.persistence.PostgreSQLDialect
      - hibernate_connection_driver_class=org.postgresql.Driver
      - hibernate_connection_url=jdbc:postgresql://onedev-db:5432/onedev
      - hibernate_connection_username=onedev-user
      - hibernate_connection_password=changeMe.aHighlyComplexPasswordToKeepYouSecure
      - initial_user=LocalUser
      - initial_password=Password
      - initial_email=username@local.com
      - initial_server_url=https://onedev.domain.local
      - initial_ssh_root_url=ssh://onedev.domain.local
    volumes:
      - 'onedev-app-data-vol:/opt/onedev'
      - '/var/run/docker.sock:/var/run/docker.sock'
    networks:
      - 'onedev-network'
    ports:
      - '6610:6610'
    depends_on:
      db:
        condition: service_healthy
  db:
    hostname: 'postgresql'
    image: 'postgres:16-alpine'
    container_name: 'onedev-db'

```

##### **The host is secured with TLS 1.3 and accessible via a web GUI. over [https://onedev.domain.local](https://onedev.domain.local)**

##### **However using unsecured http + IP + port works fine when it comes to regular git operation**

Could you please help me troubleshoot this issue?

```auto
**docker login onedev.domain.local ->> throws 401 Unauthorized
git clone ->> throws again remote 401 Unauthorized**

```

Any help would be greatly appreciated!

---

<div class="post-metadata">

### Author: ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)
#### Post date: [August 9, 2024, 5:50pm UTC](https://community.traefik.io/t/trouble-ogging-in-and-cloning-repositories-to-self-hosted-onedev-instance-behind-traefik/23950/2 "2024-08-09T17:50:53Z")

</div>

If you have an issue with Traefik, you should share your static and dynamic config, and `docker-compose.yml` if used.

Enable and check Traefik debug log and Traefik access log in JSON format.

---

<div class="post-metadata">

### Author: ![innomatrix](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/innomatrix/32/9164_2.png) [@innomatrix](https://community.traefik.io/u/innomatrix)
#### Post date: [August 10, 2024, 12:13pm UTC](https://community.traefik.io/t/trouble-ogging-in-and-cloning-repositories-to-self-hosted-onedev-instance-behind-traefik/23950/3 "2024-08-10T12:13:38Z")

</div>

I identified that the custom Traefik error-catcher middleware was the source of the problem. When first request hit the self-hosted GIT instance and there are no creds provided yet it responds with 401 and this is a moment whern middleware took over. Thx for your time anyways!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)
#### Post date: [August 13, 2024, 12:14pm UTC](https://community.traefik.io/t/trouble-ogging-in-and-cloning-repositories-to-self-hosted-onedev-instance-behind-traefik/23950/4 "2024-08-13T12:14:17Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
