unexpected EOF when cloning local git repository
Bug description Deployment error unable to clone git repository: failed to clone git repository: unexpected EOF
Expected behavior Should be able to clone a local git repository
Portainer Logs time="2022-07-03T12:31:37+02:00" level=info msg="2022/07/03 12:31:37 http error: Unable to clone git repository (err=unable to clone git repository: failed to clone git repository: unexpected EOF) (code=500)
Steps to reproduce the issue: 1 - Create a local repository served by nginx with https enabled Serveur conf => server { listen 443 ssl;
server_name git.ndd.tld;
charset utf-8;
root /volume1/git;
access_log /var/log/nginx/portgit-acces.log;
error_log /var/log/nginx/portgit-error.log debug;
index index.html index.htm index.cgi index.php index.php5 ;
ssl on;
ssl_certificate /volume1/conf/fullchain.cer;
ssl_certificate_key /volume1/conf/key.cer;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
location ~ (/.*) {
auth_basic "Restricted";
auth_basic_user_file /volume1/conf/.htpasswd;
}
}
2- create a local git repository git init --bare --initial-branch=master git symbolic-ref HEAD refs/heads/master git config http.followRedirects true git config http.receivepack true git config http.postBuffer 157286400 git config core.compression 0 git update-server-info chown -R http:http /volume1/git/bare chmod -R 755 /volume1/git/bare
3- add files to the repository
clone
git clone /volume1/git/bare.git /volume1/git/tmp cd /volume1/git/tmp rm -rf *
add files
cp -R /volume1/conf/* .
commit
git config --local user.name "git" git config --local user.email "[email protected]" git config --local --bool http.receivepack true git add . git commit -a -m "Update" git push origin master cd - > /dev/null rm -rf /volume1/git/tmp
update serv
cd /volume1/git/bare.git git update-server-info cd - > /dev/null
4- try to clone with any git client git clone https://ndd.tld:443/bare.git /d/tmp/test
it will succeed without error
5- try to create a stack in portainer, using the same address unable to clone git repository: failed to clone git repository: unexpected EOF with and without credentials it is the same result
Technical details:
- Portainer version: 2.14.0
- Docker version (managed by Portainer): 18.09
- Kubernetes version (managed by Portainer):
- Platform (windows/linux): linux
- Command used to start Portainer (
docker run -p 9443:9443 portainer/portainer): sudo docker run -d -p 6000:8000 -p 6001:9000 --restart=unless-stopped --name="portainer_temp" -v /etc/localtime:/etc/localtime -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ce:latest - Browser: chrome
- Use Case (delete as appropriate): Using Portainer at Home,
- Have you reviewed our technical documentation and knowledge base? Yes
Additional context Issue could be related to git client (server side log show git/1.0 in case of portainer, vs git/2/31/1/windows.1 in my case)
Hi @Arch-Impuls - Thanks for submitting this. Will you please verify what version of Portainer you're running? You can just look at the bottom left navigation column for that info. Can you describe how you are creating the stack in Portainer? Are you using a compose file in the web editor, or using the git repository option? Thanks.
@Arch-Impuls
I wanted to follow up on this request. Is this still an issue upon upgrading to the latest version of Portainer? Are you deploying via web editor or the repository?
Thanks!
@tamarahenson
Same issue here. Setup is similar, but I am using http instead of https.
portainer.io Community Edition 2.17.0 I am trying to deploy the stack using the git repository option (with Authentication). Repository reference is empty, there is only the master branch.
What I tried:
- git clone over http from other clients works fine.
- credentials are correct. If I change them, I get "Invalid git credential".
- Repository URL is correct. If I change it, I get "repository not found".
- It makes no difference whether I name the docker-compose file "docker-compose.yml" or "docker-compose.yaml".
- It makes no difference whether I put the docker-compose file in root or a sub-directory.