Skip to content
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

[Bug]: Git Basic auth not url encoded causes error with private deployments #5295

Open
richardARPANET opened this issue Mar 6, 2025 · 10 comments
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.

Comments

@richardARPANET
Copy link

richardARPANET commented Mar 6, 2025

Error Message and Logs

v4.0.0-beta.397

  1. Gitlab source
  2. I have a docker compose file, tested locally, working
  3. Coolify fails to set the system up accordinglyImage

When I click reload compose file, nothing happens

Image

It even happens with an edited down very basic compose file

version: "3"
services:

  web:
    working_dir: /usr/src/app/backend/
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8000:8000"
    command: gunicorn jobs.wsgi --log-file - --bind 0.0.0.0:8000

  worker:
    working_dir: /usr/src/app/backend/
    build:
      context: .
      dockerfile: Dockerfile
    command: celery -A boiler_room.celery worker --loglevel=info -c 3

  beat:
    working_dir: /usr/src/app/backend/
    build:
      context: .
      dockerfile: Dockerfile
    command: celery -A boiler_room.celery beat --loglevel=info -s schedule

logs

  2025-03-06 07:05:03 App\Jobs\ServerCheckJob ........................ 1s DONE
  2025-03-06 07:05:21 App\Actions\Docker\GetContainersStatus ......... RUNNING
  2025-03-06 07:05:21 App\Actions\Docker\GetContainersStatus ... 440.09ms DONE
2025/03/06 07:05:25 [error] 153#153: *21199 upstream timed out (110: Operation timed out) while reading response header from upstream, client: <redacted>, server: _, request: "POST /livewire/update HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<redacted>:8000", referrer: "http://<redacted>:8000/project/d8soww0ck8o0g4ww48k4cg08/environment/cwsw0owswccsok44k8sso0wg/application/xcwwwwwk040o44osw0csokc4"
2025/03/06 07:05:34 [error] 152#152: *21212 upstream timed out (110: Operation timed out) while reading response header from upstream, client: <redacted>, server: _, request: "POST /livewire/update HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<redacted>:8000", referrer: "http://<redacted>:8000/project/d8soww0ck8o0g4ww48k4cg08/environment/cwsw0owswccsok44k8sso0wg/application/xcwwwwwk040o44osw0csokc4"
  2025-03-06 07:06:00 Running [App\Jobs\CleanupInstanceStuffsJob]  9.55ms DONE

Steps to Reproduce

  1. as above

Example Repository URL

No response

Coolify Version

v4.0.0-beta.397

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

No response

Additional Information

No response

@richardARPANET richardARPANET added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Mar 6, 2025
@LaurenceJJones
Copy link
Contributor

Could the issue be that you are binding to port 8000?

    ports:
      - "8000:8000"

And that should be needed if you are using the coolify proxy, so if you remove it does it deploy?

@richardARPANET
Copy link
Author

richardARPANET commented Mar 6, 2025

Could the issue be that you are binding to port 8000?

    ports:
      - "8000:8000"

And that should be needed if you are using the coolify proxy, so if you remove it does it deploy?

  1. deleted project
  2. recreated with the below docker compose file
version: "3"
services:

  web:
    working_dir: /usr/src/app/backend/
    build:
      context: .
      dockerfile: Dockerfile
    command: gunicorn jobs.wsgi --log-file - --bind 0.0.0.0:8000

  worker:
    working_dir: /usr/src/app/backend/
    build:
      context: .
      dockerfile: Dockerfile
    command: celery -A boiler_room.celery worker --loglevel=info -c 3

  beat:
    working_dir: /usr/src/app/backend/
    build:
      context: .
      dockerfile: Dockerfile
    command: celery -A boiler_room.celery beat --loglevel=info -s schedule

result:

Image

logs:

 

2025-03-06 08:36:14 cleanup:stucked-resources ................ 119.55ms DONE
2025-03-06 08:36:14 App\Jobs\CleanupHelperContainersJob ............ RUNNING
2025-03-06 08:36:15 App\Jobs\CleanupHelperContainersJob ...... 709.55ms DONE
2025-03-06 08:36:15 App\Actions\Server\CleanupDocker ............... RUNNING
2025-03-06 08:36:16 App\Actions\Server\CleanupDocker ............... 1s DONE
2025-03-06 08:36:16 App\Actions\Server\CleanupDocker ............... RUNNING
2025-03-06 08:36:16 App\Actions\Server\CleanupDocker ......... 655.58ms DONE
2025-03-06 08:36:16 App\Actions\Server\CleanupDocker ......... 944.92ms DONE
2025-03-06 08:37:00 Running [App\Jobs\ServerCheckJob] ......... 14.82ms DONE
2025-03-06 08:37:00 Running [App\Jobs\ServerCheckJob] .......... 0.68ms DONE

2025-03-06 08:37:01 App\Jobs\ServerCheckJob ........................ RUNNING
2025-03-06 08:37:01 App\Jobs\ServerCheckJob .................. 409.37ms DONE
2025-03-06 08:37:01 App\Jobs\ServerCheckJob ........................ RUNNING
2025-03-06 08:37:03 App\Jobs\ServerCheckJob ........................ 1s DONE
2025-03-06 08:37:32 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:37:32 App\Actions\Docker\GetContainersStatus ... 426.22ms DONE
2025-03-06 08:38:00 Running [App\Jobs\CleanupInstanceStuffsJob] 12.89ms DONE
2025-03-06 08:38:00 Running [App\Jobs\ServerCheckJob] .......... 5.08ms DONE
2025-03-06 08:38:00 Running [App\Jobs\ServerCheckJob] .......... 0.66ms DONE
2025-03-06 08:38:00 Running ['artisan' uploads:clear] ........ 380.83ms DONE
⇂ '/usr/local/bin/php' 'artisan' uploads:clear > '/dev/null' 2>&1

2025-03-06 08:38:01 App\Jobs\CleanupInstanceStuffsJob .............. RUNNING
2025-03-06 08:38:01 App\Jobs\CleanupInstanceStuffsJob ......... 46.95ms DONE
2025-03-06 08:38:01 App\Jobs\ServerCheckJob ........................ RUNNING
2025-03-06 08:38:01 App\Jobs\ServerCheckJob .................. 371.37ms DONE
2025-03-06 08:38:01 App\Jobs\ServerCheckJob ........................ RUNNING
2025-03-06 08:38:03 App\Jobs\ServerCheckJob ........................ 1s DONE
2025/03/06 08:38:20 [error] 119#119: *2531 upstream timed out (110: Operation timed out) while reading response header from upstream, client: [REDACTED], server: _, request: "POST /livewire/update HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "[REDACTED]:8000", referrer: "http://[REDACTED]:8000/project/d8soww0ck8o0g4ww48k4cg08/environment/cwsw0owswccsok44k8sso0wg/application/usw0ck84gc4s8k8k8ocs0wc8"
2025-03-06 08:38:21 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:21 App\Actions\Docker\GetContainersStatus ... 437.78ms DONE
2025-03-06 08:38:21 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:22 App\Actions\Docker\GetContainersStatus ... 248.79ms DONE
2025-03-06 08:38:22 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:22 App\Actions\Docker\GetContainersStatus ... 237.74ms DONE
2025-03-06 08:38:22 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:22 App\Actions\Docker\GetContainersStatus ... 227.47ms DONE
2025-03-06 08:38:22 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:22 App\Actions\Docker\GetContainersStatus ... 447.83ms DONE
2025/03/06 08:38:30 [error] 119#119: *2514 upstream timed out (110: Operation timed out) while reading response header from upstream, client: [REDACTED], server: _, request: "POST /livewire/update HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "[REDACTED]:8000", referrer: "http://[REDACTED]:8000/project/d8soww0ck8o0g4ww48k4cg08/environment/cwsw0owswccsok44k8sso0wg/application/usw0ck84gc4s8k8k8ocs0wc8"
2025-03-06 08:38:31 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:31 App\Actions\Docker\GetContainersStatus ... 301.10ms DONE
2025-03-06 08:38:33 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:33 App\Actions\Docker\GetContainersStatus ... 437.31ms DONE
2025-03-06 08:38:33 App\Actions\Docker\GetContainersStatus ......... RUNNING
2025-03-06 08:38:34 App\Actions\Docker\GetContainersStatus ... 258.23ms DONE

@richardARPANET
Copy link
Author

Tried compose file below, same result. Its worrying this basic feature is broken and there's no hint to how to resolve given on the UI

version: '3'

services:
  web:
    image: nginx:latest
    ports:
      - "80:80"
    volumes:
      - ./html:/usr/share/nginx/html
    restart: always

@djsisson
Copy link
Contributor

djsisson commented Mar 6, 2025

@richardARPANET

is the compose in your repo definately named docker-compose.yaml?

or is it named docker-compose.yml ?

@richardARPANET
Copy link
Author

@richardARPANET

is the compose in your repo definately named docker-compose.yaml?

or is it named docker-compose.yml ?

I checked the filename being correct about 20x, so this is a bug. I've switched to dokku now instead

@ShadowArcanist
Copy link
Member

I just tried deploying a git source + docker compose file and it works fine for me on v4 beta 397 - https://github.com/coollabsio/coolify-examples/blob/main/docker-compose-test/docker-compose.yaml

Image

The basic auth is part of the compose file, so if the compose deployment is not working then i shouldn't see the login prompt like this.
Image

@richardARPANET
Copy link
Author

New test, that exact compose file you posted, I put in my git repo -> pushed -> clicked 'reload compose file' on UI. New coolify installation. Same result.

This suggests there may be a bug with the private Git repo integration code in Coolify perhaps? As you are using a public repo, I'm using self hosted private gitlab with http auth.

@richardARPANET
Copy link
Author

If i instead just make a project which doesnt use git and i just copy paste your compose file linked contents, it works. This also suggests the bug is with the private git auth perhaps

@richardARPANET
Copy link
Author

ah, i've fixed it.

the problem is due to coolify not urlencoding the user/pass http basic auth params in the https git url

e.g.

if i input git source:

it wont work

it i instead url encode the username myself first and do it:

https://richard%40email.com:[email protected]/xx/yy.git

success, compose file now parses

Image

@LaurenceJJones
Copy link
Contributor

Awesome! at least we know what the issue is so we can change the title too:

[Bug]: Basic auth not url encoded causes error with private deployments

I dont have permission 😆

@richardARPANET richardARPANET changed the title [Bug]: Git source + Docker Compose file = does not work [Bug]: Git Basic auth not url encoded causes error with private deployments Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization.
Projects
None yet
Development

No branches or pull requests

4 participants