Fail to clone submodules behind reverse proxy (OD-2032)
Daniel opened 1 year ago

Dear all,

we are facing the issue that submodules cannot be cloned within our pipeline. Our Onedev is behind an reverse proxy (Caddy). Access Token is used for authentification.

19:52:18 Pending resource allocation...
19:52:18 Executing job (executor: Docker-Executor, server: X.X.X.X:5710, network: Docker-Network)...
19:52:19 Copying job dependencies...
19:52:19 Running step "Checkout Code"...
19:52:19 Checking out code...
19:52:19 Retrieving submodules...
19:52:19 fatal: unable to access 'https://onedev/Project/': Failed to connect to onedev port 443 after 0 ms: Couldn't connect to server
19:52:19 fatal: clone of 'https://onedev/Project' into submodule path '/opt/onedev/temp/server/onedev-build-452-444/workspace/Project' failed
19:52:19 Failed to clone 'Project'. Retry scheduled

Do you have any idea how to fix the problem?

Thank you!

  • Robin Shen commented 1 year ago

    Are you able to clone this project with submodules from your terminal?

    git clone --recurse-submodules https://onedev/YourMainProject
    
  • Tobias commented 1 year ago

    In our tests in the terminal of the OneDev container, the command worked with http://onedev:6610.

    The reverse proxy container (Caddy) has its own network in which the OneDev container is also located. We then tried to bring the Docker container of the Job Executor into the Docker network of the Caddy Reverse Proxy with the setting “--network=” under the “Run Options”.

    The following error message then appeared: docker: Error response from daemon: Container cannot be connected to network endpoints: Docker-0, caddy_network.

    Do you have any idea how the Docker containers of the steps can be set to a specific network?

    Thank you.

  • Robin Shen commented 1 year ago

    Never tried with that approach. You may run a docker container manually from terminal on same machine running OneDev job executor to see if it can access your Caddy network.

  • Tobias commented 1 year ago

    The command to clone the submodules works if we run a Docker container in the same network as the OneDev container.

    Unfortunately, the existing network option in the Job Executor, which creates a new network, does not help in this case.

    It would be nice to have an option in the job executors to select whether the executor should create its own random network or connect to an existing network from the start.

  • Robin Shen commented 1 year ago

    OneDev runs each build in a separate network for isolation purpose (job might be accessing service with same name etc.). Normally containers inside newly created network should be able to access hosts outside the network. If you describe the reproduding steps in more detail, I will check to see if there are workarounds.

  • Robin Shen removed comment 1 year ago
  • Robin Shen removed comment 1 year ago
  • Robin Shen changed state to 'Closed' 1 year ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 1 year ago

    Reopen if there is more info

issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (5)
Reference
OD-2032
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover