Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: An attempt to run a request with a Faraday::Connection without adapter has been made #1247

Open
oleksii-mykhniak opened this issue Jan 4, 2022 · 5 comments · May be fixed by #1249

Comments

@oleksii-mykhniak
Copy link

oleksii-mykhniak commented Jan 4, 2022

I'm using dpl in GitLab for Heroku CI/CD and I have the next error:

/usr/local/bundle/gems/faraday-2.0.0/lib/faraday/rack_builder.rb:230:in `ensure_adapter!': An attempt to run a request with a Faraday::Connection without adapter has been made. (RuntimeError)
Please set Faraday.default_adapter or provide one when initializing the connection.
For more info, check https://lostisland.github.io/faraday/usage/.
	from /usr/local/bundle/gems/faraday-2.0.0/lib/faraday/rack_builder.rb:166:in `app'
	from /usr/local/bundle/gems/faraday-2.0.0/lib/faraday/rack_builder.rb:153:in `build_response'
	from /usr/local/bundle/gems/faraday-2.0.0/lib/faraday/connection.rb:445:in `run_request'
	from /usr/local/bundle/gems/faraday-2.0.0/lib/faraday/connection.rb:200:in `get'
	from /usr/local/bundle/gems/dpl-heroku-1.10.16/lib/dpl/provider/heroku/generic.rb:43:in `check_auth'
	from /usr/local/bundle/gems/dpl-1.10.16/lib/dpl/provider.rb:187:in `block in deploy'
	from /usr/local/bundle/gems/dpl-1.10.16/lib/dpl/cli.rb:41:in `fold'
	from /usr/local/bundle/gems/dpl-1.10.16/lib/dpl/provider.rb:186:in `deploy'
	from /usr/local/bundle/gems/dpl-1.10.16/lib/dpl/cli.rb:32:in `run'
	from /usr/local/bundle/gems/dpl-1.10.16/lib/dpl/cli.rb:7:in `run'
	from /usr/local/bundle/gems/dpl-1.10.16/bin/dpl:5:in `<top (required)>'
	from /usr/local/bundle/bin/dpl:25:in `load'
	from /usr/local/bundle/bin/dpl:25:in `<main>'

It looks like a problem in the faraday-2.0.0 release which was a few minutes ago here

@felin-arch
Copy link

Here is a quick and dirty workaround.

Add gem install faraday -v 1.8.0 before running dpl --provider=heroku --app=$APP --api-key=$HEROKU_API_KEY.

It ain't pretty, but DEV's got to deploy.

@dzcar
Copy link

dzcar commented Jan 4, 2022

It looks like the change affected was lostisland/faraday#1354

@maidh91
Copy link

maidh91 commented Jan 6, 2022

This is my update for Gitlab CI, works perfectly with Faraday 1.8.0

deploy:
  stage: deploy
  only:
    - master
  image: ruby:latest
  script:
    - gem install dpl && gem install faraday -v 1.8.0
    - dpl --provider=heroku --app=xxx --api-key=$HEROKU_API_KEY

colindean added a commit to colindean/dpl that referenced this issue Jan 7, 2022
Fixes travis-ci#1247

Although this may not be necessary anymore because Faraday 2.0.1
reverted the change that may Faraday 2.0.0 not work:

lostisland/faraday#1362 (comment)
@colindean colindean linked a pull request Jan 7, 2022 that will close this issue
@colindean
Copy link

lostisland/faraday#1362 (comment) says that Faraday 2.0.1 reverted/fixed the change that made Faraday 2.0.0 not work but I put up #1249 just in case that doesn't work or it changes, so that someone who is maintaining dpl can qualify dpl against Faraday 2.x properly.

@farrukh-malik
Copy link

I faced the same problem today. Apparently there is some problem in the latest version of FARADAY, at the moment. I solved it this way: add manual installation of the previous version of the dependency to your .gitlab.yml, and everything will work. Have a nice day.

before_script:
  - apt-get update -qy
  - apt-get install -y ruby-dev
  - gem install dpl
  - gem install faraday -v 1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants