Ubuntu jammy: Installing deploy dependencies: failed to deploy

Log: https://api.travis-ci.com/v3/job/607925220/log.txt

I decided to try to build my project with specifying “dist: jammy” instead of “focal”. The build itself went well, however some ruby related error stopped the process at Installing deploy dependencies.

It’s possible that it would work with some “apt-get upgrade” (or dist-upgrade?) also included in the build script, however I find these kind of things problematic, as it greatly increases the build time, thus the amount of consumed credits per build.

Installing deploy dependencies
Successfully installed public_suffix-3.0.3
Successfully installed multipart-post-2.3.0
Successfully installed faraday-0.15.4
Successfully installed addressable-2.8.5
Successfully installed sawyer-0.8.2
Successfully installed octokit-4.6.2
Successfully installed dpl-pages-1.10.16
7 gems installed
/home/travis/.rvm/gems/ruby-3.1.2/gems/faraday-0.15.4/lib/faraday/options.rb:166:in `new': tried to create Proc object without a block (ArgumentError)
	from /home/travis/.rvm/gems/ruby-3.1.2/gems/faraday-0.15.4/lib/faraday/options.rb:166:in `memoized'
	from /home/travis/.rvm/gems/ruby-3.1.2/gems/faraday-0.15.4/lib/faraday/options.rb:247:in `<class:ProxyOptions>'
	from /home/travis/.rvm/gems/ruby-3.1.2/gems/faraday-0.15.4/lib/faraday/options.rb:229:in `<module:Faraday>'
[...etc...]
failed to deploy

Please see the full log at the URL above.

My .travis.yml file: https://raw.githubusercontent.com/lgblgblgb/xemu/dev/.travis.yml

So, the core problem of Travis seems to be this one:

/home/travis/.rvm/gems/ruby-3.1.2/gems/faraday-0.15.4/lib/faraday/options.rb:166:in `new’: tried to create Proc object without a block (ArgumentError)

EDIT: just found this report: Github-release fail after ruby version update It is very similar, however I don’t have any “edge” specification. Also it seems to be an older report, which commented to fixed by now.

1 Like

Answering myself … Not the solution but maybe the cause: I’ve tried to google about the problem and found this: .rvm/gems/ruby-head/gems/faraday-0.15.4/lib/faraday/options.rb:166: warning: tried to create Proc object without a block · Issue #961 · lostisland/faraday · GitHub

So in nutshell, it seems, in ruby 2.7 there was a change which brakes older version of ruby_faraday. The solution seems to be to use up-to-date faraday, the issue mentions 1.0 and it seems travis uses 0.15 or something, however ruby seems to be 3.0 (so well above 2.7). Thus the incompatibility.

Unfortunately I don’t know about ruby too much, and I am not sure I can fix this, as my own, like giving various commands in the yml section before_deploy. Since the ruby/gem stuff happens outside of my control when hitting the deploy section, as far as I can see.

Please fix the image, thanks!

Further experiments: with zero knowledge on ruby, I tried this (in .travis.yml):

  before_deploy:
    - build/deploy/before-deploy.sh xemu-deploy Linux
    - gem install specific_install || true
    - gem specific_install https://github.com/tumblr/tumblr_client || true
    - gem specific_install https://github.com/lostisland/faraday || true

According the log, some much more decent than version 0.15 of faraday has been installed:

$ gem specific_install https://github.com/lostisland/faraday || true
git version 2.40.1
http installing from https://github.com/lostisland/faraday
[...] 
Successfully built RubyGem
  Name: faraday
  Version: 2.7.10
  File: faraday-2.7.10.gem
Successfully installed

However it seems the deploy process does its own thing whatever I do before :frowning:

Installing deploy dependencies
Successfully installed public_suffix-3.0.3
Successfully installed faraday-0.15.4
Successfully installed addressable-2.8.5
Successfully installed sawyer-0.8.2
Successfully installed octokit-4.6.2
Successfully installed dpl-pages-1.10.16
6 gems installed
/home/travis/.rvm/gems/ruby-3.1.2/gems/faraday-0.15.4/lib/faraday/options.rb:166:in `new': tried to create Proc object without a block (ArgumentError)

Note about faraday-0.15.4

FYI I’ve received the following information from Travis support:

It seems jammy doesn’t support ruby versions below v3.x. Since our deployment tool[1] relies on a lower version due to some dependencies, this was raised with our engineering team for a fix to be made. Please keep an eye out on our changelog for further correspondence in this regard.

[1] GitHub - travis-ci/dpl: Dpl (dee-pee-ell) is a deploy tool made for continuous deployment.

Not sure if it’s relevant to your particular pipeline but I had the same failure during the deploy stage. Turned out using Focal instead of Jammy fixes the problem for me. HTH