semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Cloning Repository http:// ... Cloning into repository ... fatal: bad numeric config value '0' ' for 'GIT_TERMINAL_PROMPT': invalid unit

Open erioshi opened this issue 3 years ago • 3 comments

I recently set up a new docker host with new gitbucket, mariadb and ansible-semaphore containers.

Unfortunately while gitbucket and mariadb seem to be working as expected, ansible-semaphore is giving me issues.

The GUI seems to be unable to successfully authenticate and create a clone of my git repository.

When I manually log into the ansible-semaphore container and run a git clone command, even with the branch option, the process completes successfully. The same credentials were used in the manual tests that were using in the GUI repository configuration.

Here is the captured output from a failed GUI task run:

11:45:13 AM Task 39 added to queue 11:45:16 AM Preparing: 39 11:45:16 AM Prepare TaskRunner with template: smboot 11:45:16 AM Cloning Repository http://[email protected]:8081/git/sm_ansible/ansible_2x.git 11:45:16 AM Cloning into 'repository_5_3'... 11:45:17 AM fatal: bad numeric config value '0' for 'GIT_TERMINAL_PROMPT': invalid unit 11:45:17 AM Failed updating repository: exit status 128`

Here is a successful manual clone from inside the semaphore container:

~ $ ls -lh total 4K
-rw-r--r-- 1 semaphor root 1.2K Jul 3 16:35 config.json ~ $ git clone -b master http://[email protected]:8081/git/sm_ansible/ansible_2x.git Cloning into 'ansible_2x'... Password for 'http://[email protected]:8081': remote: Counting objects: 3, done remote: Finding sources: 100% (3/3) remote: Getting sizes: 100% (2/2) remote: Compressing objects: 100% (1215/1215) remote: Total 3738 (delta 0), reused 3736 (delta 0) Receiving objects: 100% (3738/3738), 548.68 MiB | 65.60 MiB/s, done. Resolving deltas: 100% (1596/1596), done. ~ $ ls -lh total 8K
drwxr-sr-x 18 semaphor root 4.0K Jul 3 17:10 ansible_2x -rw-r--r-- 1 semaphor root 1.2K Jul 3 16:35 config.json ~ $

All of my other connections to the gitbucket container are running as expected as well.

I have created connections to other repositories on the same local gitbucket server and receive the same error.

I do have a proper password only credential set up in the GUI for repository user m. I receive the same failure message regardless of how I attempt to connect. I have tested a straight http connection with a username and password credential, the http connection with the embedded user name and a password only credential, and an http token based connection. all of them fail with the same error.

erioshi avatar Jul 03 '22 17:07 erioshi

It looks like my issue may be related to a prior issue already tagged as a bug: https://github.com/ansible-semaphore/semaphore/issues/871

Someone there mentioned using a PAT as a work-around, but that also fails for me with semaphore running from a docker hub image using http.

erioshi avatar Jul 04 '22 11:07 erioshi

This issue also looks to be related: https://github.com/ansible-semaphore/semaphore/issues/910

erioshi avatar Jul 04 '22 11:07 erioshi

As part of testing I built a fresh container using gitea instead of GiBucket as a git repository.

With gitea as the repo I was able to complete the clone repo portion of running a playbook only once before all subsequent runs failed at the clone setep with the same errors listed above.

erioshi avatar Jul 04 '22 17:07 erioshi

Same issue here, except I have only been using gitea (and nothing else) and I wasn't able to clone even once (other than manually).

Any solution in sight? I am just starting out with Semaphore but I don't know how I can use it at all, if I can't clone the repo...

gitwittidbit avatar Aug 22 '22 07:08 gitwittidbit

I'm thinking I may build a VM and see if the VM has the same issue as the container. No reason to expect different behavior, but it is probably worth the effort of a test.

erioshi avatar Aug 22 '22 17:08 erioshi

I did just re-try all of this with a pull of the development container, and that failed as well. I also turned on the debug flag and that added a line to the error message:

12:54:48 PM ' for 'GIT_TERMINAL_PROMPT': invalid unit

Otherwise all of the output was essentially the same.

erioshi avatar Aug 22 '22 18:08 erioshi

I'm thinking I may build a VM and see if the VM has the same issue as the container. No reason to expect different behavior, but it is probably worth the effort of a test.

You can probably save yourself the effort: I am running gitea and ansible/semaphore in VMs.

gitwittidbit avatar Aug 23 '22 19:08 gitwittidbit

Thank you for that info. I also tried the "develop" tagged version of the container and had the same failure.

erioshi avatar Aug 25 '22 15:08 erioshi

I tried with a personal access token and with a public repository. In both cases the same failure as well.

I have no idea what the problem might be.

The only solution I can think of atm is to install awx or rundeck or some other alternative. Or use ansible from the command line.

gitwittidbit avatar Aug 25 '22 19:08 gitwittidbit

Interestingly DesireWithin had success connecting to an HTTPs GitLab repository. He provided that update in the issue reference above. He did not specify if the GitLab instance was the public web instance or a private repository.

My use case for Ansible-Semaphore is for managing playbooks before a Kubernetes cluster has been fully provisioned. Once Kubernetes is fully provisioned I can bring AWX online to manage playbooks.

erioshi avatar Sep 06 '22 14:09 erioshi

'GIT_TERMINAL_PROMPT': invalid unit is useless message but it is mean - you need authentication. You should provide login/password if you use https protocol.

fiftin avatar Sep 19 '22 16:09 fiftin

Continue here: https://github.com/ansible-semaphore/semaphore/issues/1025

fiftin avatar Sep 19 '22 16:09 fiftin