Bug 220795

Summary: devel/gitlab-runner: using port report status=500 Internal Server Error, while using official binary ok
Product: Ports & Packages Reporter: Jov <amutu>
Component: Individual Port(s)Assignee: Steve Wills <swills>
Status: Closed FIXED    
Severity: Affects Only Me CC: pikachu17997
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (swills)
koobs: merge-quarterly?
Hardware: Any   
OS: Any   

Description Jov 2017-07-17 10:37:28 UTC
pkg info | grep gitlab
gitlab-runner-1.11.1_1         Official GitLab Runner written in Go

I download the offical binary from https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-freebsd-amd64 replace the port binary, everything works fine.

log for port binary:
gitlab-runner -l "debug" --debug run
Runtime platform                                    arch=amd64 os=freebsd revision=08a9e6f version=1.11.1
WARNING: No service system detected. Some features may not work! 
Starting multi-runner from /etc/gitlab-runner/config.toml ...  builds=0
Checking runtime mode                               GOOS=freebsd uid=0
Running in system-mode.                            
                                                   
Configuration loaded                                builds=0
metricsserveraddress: ""
concurrent: 1
checkinterval: 0
user: ""
runners:
- name: fb10.3-amd64
  limit: 0
  outputlimit: 0
  runnercredentials:
    url: https://gitlab.com/
    token: xxx
    tlscafile: ""
  runnersettings:
    executor: shell
    buildsdir: ""
    cachedir: ""
    environment: []
    preclonescript: ""
    prebuildscript: ""
    postbuildscript: ""
    shell: ""
    ssh: null
    docker: null
    parallels: null
    virtualbox: null
    cache:
      type: ""
      serveraddress: ""
      accesskey: ""
      secretkey: ""
      bucketname: ""
      bucketlocation: ""
      insecure: false
      path: ""
      shared: false
    machine: null
    kubernetes: null
sentrydsn: null
modtime: 2017-07-17T18:04:34.316442+08:00
loaded: true
  builds=0
Metrics server disabled                            
Feeding runners to channel                          builds=0
Starting worker                                     builds=0 worker=0
Trying to load /etc/gitlab-runner/certs/gitlab.com.crt ... 
Dialing: tcp gitlab.com:443 ...                    
Checking for builds... nothing                      runner=e8a79036
Feeding runners to channel                          builds=0
Feeding runners to channel                          builds=0
Checking for builds... nothing                      runner=e8a79036
WARNING: Checking for builds... failed              runner=e8a79036 status=500 Internal Server Error
Feeding runners to channel                          builds=0
Checking for builds... nothing                      runner=e8a79036
Feeding runners to channel                          builds=0
Feeding runners to channel                          builds=0
^CWARNING: Requested service stop: <nil>              builds=0
Comment 1 Steve Wills freebsd_committer freebsd_triage 2017-07-20 18:41:36 UTC
I'm not able to reproduce this. First I installed a fresh VM, then installed the package. Then I ran "service gitlab_runner register" and configured the runner. Then to verify:

# su -m gitlab-runner -c "env HOME=/var/tmp/gitlab_runner gitlab-runner -l debug --debug run"
Runtime platform                                    arch=amd64 os=freebsd revision=08a9e6f version=1.11.1
WARNING: No service system detected. Some features may not work!                                 
Starting multi-runner from /var/tmp/gitlab_runner/.gitlab-runner/config.toml ...  builds=0       
Checking runtime mode                               GOOS=freebsd uid=474                         
WARNING: Running in user-mode.                                                                   
WARNING: Use sudo for system-mode:                                                               
WARNING: $ sudo gitlab-runner...                                                                 
                                                                                                 
Configuration loaded                                builds=0                                     
metricsserveraddress: ""                                                                         
concurrent: 1                                                                                    
checkinterval: 0
user: ""
runners:
- name: vagrant-vm-runner
  limit: 0
  outputlimit: 0
  runnercredentials:
    url: https://gitlab.domain.elided/
    token: 1ecb7c52f3ab9158b77d6fc7678707
    tlscafile: ""
  runnersettings:
    executor: shell
    buildsdir: ""
    cachedir: ""
    environment: []
    preclonescript: ""
    prebuildscript: ""
    postbuildscript: ""
    shell: ""
    ssh: null
    docker: null
    parallels: null
    virtualbox: null
    cache:
      type: ""
      serveraddress: ""
      accesskey: ""
      secretkey: ""
      bucketname: ""
      bucketlocation: ""
      insecure: false
      path: ""
      shared: false                             
    machine: null                               
    kubernetes: null                            
sentrydsn: null                                 
modtime: 2017-07-20T18:25:45.795733Z            
loaded: true                                    
  builds=0                                      
Metrics server disabled                                                                          
Starting worker                                     builds=0 worker=0                            
Feeding runners to channel                          builds=0                                     
Trying to load /var/tmp/gitlab_runner/.gitlab-runner/certs/gitlab.domain.elided.crt ...               
Dialing: tcp gitlab.domain.elided:443 ...                                                             
Checking for builds... nothing                      runner=1ecb7c52                              
Feeding runners to channel                          builds=0                                     
Checking for builds... nothing                      runner=1ecb7c52                              
Feeding runners to channel                          builds=0                                     
Checking for builds... nothing                      runner=1ecb7c52                              


I think even if I could reproduce the error, the 500 error is from GitLab, not the command line client. What version of GitLab are you using?
Comment 2 Steve Wills freebsd_committer freebsd_triage 2017-07-20 23:21:57 UTC
Also, I upgraded the port to 9.3.0, can you test the new version?
Comment 3 Jov 2017-07-20 23:33:31 UTC
(In reply to Steve Wills from comment #1)
The project is host on gitlab.com,I am not sure the gitlab version of gitlab.com.maybe the problems is because of version mismatch? I will try 9.3 runner today.
Comment 4 Steve Wills freebsd_committer freebsd_triage 2017-07-21 02:55:58 UTC
(In reply to Jov from comment #3)
Maybe. I just tested the 9.3.0 gitlab-runner against gitlab.com and had no issue. Let me know what you find.
Comment 5 Jov 2017-07-21 03:49:23 UTC
(In reply to Steve Wills from comment #4)
I just tested with the 9.3 runner, everything works.

In fact, it also fixes another problem which the same runner will hang when the second job triggered. I used crontab to restart gitlab_runner every 15 minutes as a workaround.

Thanks very much!
Comment 6 Sunny007 2019-05-24 15:34:53 UTC
MARKED AS SPAM