dependabot / dependabot-script

A simple script that demonstrates how to use Dependabot Core
MIT License
555 stars 275 forks source link

Running Dependabot on private Project on private GitLab #688

Closed pkolodziejczyk closed 3 years ago

pkolodziejczyk commented 3 years ago

Hi,

(I am new to most of the technology used here)

I have clone the project on the Docker image of ruby:last

Then I have rune the following command :

export GITLAB_ASSIGNEE_ID=pko
export GITLAB_HOSTNAME=https://**domain_of the gitlab_in_my network**
export GITLAB_ACCESS_TOKEN=**access_token_gitlab_of_my_private_gitlab*
export PACKAGE_MANAGER=maven
export PROJECT_PATH=*GroupName1*/*GroupName2*/*ProjectName*
export BRANCH=develop

bundle exec ruby ./generic-update-script.rb

warning: parser/current is loading parser/ruby30, which recognizes warning: 3.0.1-compliant syntax, but you are running 3.0.2. warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri. Fetching maven dependency files for ArchiDev/Services/TaskService /usr/local/lib/ruby/3.0.0/net/http.rb:987:in initialize': Failed to open TCP connection to https:443 (getaddrinfo: Name or service not known) (SocketError) from /usr/local/lib/ruby/3.0.0/net/http.rb:987:inopen' from /usr/local/lib/ruby/3.0.0/net/http.rb:987:in block in connect' from /usr/local/lib/ruby/3.0.0/timeout.rb:97:inblock in timeout' from /usr/local/lib/ruby/3.0.0/timeout.rb:107:in timeout' from /usr/local/lib/ruby/3.0.0/net/http.rb:985:inconnect' from /usr/local/lib/ruby/3.0.0/net/http.rb:970:in do_start' from /usr/local/lib/ruby/3.0.0/net/http.rb:959:instart' from /usr/local/lib/ruby/3.0.0/net/http.rb:1512:in request' from /usr/local/bundle/gems/httparty-0.18.1/lib/httparty/request.rb:145:inperform' from /usr/local/bundle/gems/httparty-0.18.1/lib/httparty.rb:594:in perform_request' from /usr/local/bundle/gems/httparty-0.18.1/lib/httparty.rb:508:inget' from /usr/local/bundle/gems/gitlab-4.17.0/lib/gitlab/request.rb:51:in block (2 levels) in <class:Request>' from /usr/local/bundle/gems/gitlab-4.17.0/lib/gitlab/client/branches.rb:32:inbranch' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/clients/gitlab_with_retries.rb:67:in public_send' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/clients/gitlab_with_retries.rb:67:inblock in method_missing' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/clients/gitlab_with_retries.rb:82:in retry_connection_failures' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/clients/gitlab_with_retries.rb:64:inmethod_missing' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/clients/gitlab_with_retries.rb:47:in fetch_commit' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/file_fetchers/base.rb:72:incommit' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/file_fetchers/base.rb:359:in _full_specification_for' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/file_fetchers/base.rb:369:in_fetch_file_content' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/file_fetchers/base.rb:139:in fetch_file_from_host' from /usr/local/bundle/gems/dependabot-maven-0.142.0/lib/dependabot/maven/file_fetcher.rb:32:inpom' from /usr/local/bundle/gems/dependabot-maven-0.142.0/lib/dependabot/maven/file_fetcher.rb:25:in fetch_files' from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/file_fetchers/base.rb:64:infiles' from ./generic-update-script.rb:157:in <main>' /usr/local/lib/ruby/3.0.0/net/http.rb:987:ininitialize': getaddrinfo: Name or service not known (SocketError) from /usr/local/lib/ruby/3.0.0/net/http.rb:987:in open' from /usr/local/lib/ruby/3.0.0/net/http.rb:987:inblock in connect' from /usr/local/lib/ruby/3.0.0/timeout.rb:97:in `block in timeout'

First I did think it's was because the certificate was unknown. So I added the certificate to the system. And the wget can access the welcomepage of the GitLab.

But, I still get that error.

Maybe the error speak more here ? #hope

pkolodziejczyk commented 3 years ago

With some p (print) in files

GITLAB_HOSTNAME -> shouldn't have the protocole PROJECT_PATH -> should be the ID of the project (for genereting GITLAB_HOSTNAME/api/v4/projects/ID_PROJECT) GITHUB_ACCESS_TOKEN -> Missing

if internal maven read : https://github.com/dependabot/dependabot-core/issues/3806

if HTTPS problem : https://stackoverflow.com/questions/1113422/how-to-bypass-ssl-certificate-verification-in-open-uri https://gist.github.com/siruguri/66926b42a0c70ef7119e via

I still have Issue with

/usr/local/lib/ruby/3.0.0/net/http.rb:987:in initialize': execution expired (Faraday::ConnectionFailed) ... from /usr/local/bundle/gems/dependabot-common-0.142.0/lib/dependabot/clients/github_with_retries.rb:96:inpublic_send' ... /usr/local/lib/ruby/3.0.0/net/http.rb:987:in `initialize': execution expired (Net::OpenTimeout)

On this object :

<Faraday::Env @method=:get @url=#<URI::HTTPS https://api.github.com/repos/spring-projects/spring-boot/contents/> @request=# @request_headers={"User-Agent"=>"Octokit Ruby Gem 4.20.0", "Accept"=>"application/vnd.github.v3+json", "Content-Type"=>"application/json", "Authorization"=>"token MY_TOKEN"} @ssl=# @response=#<Faraday::Response:0x000055845ab6e5c0 @on_complete_callbacks=[]>>

I don't know why I can't access github

pkolodziejczyk commented 3 years ago

Last issue was on the network proxy (of my entreprise):

Here is what solved it :

export http_proxy=**MyProxy**
export https_proxy=**MyProxy**