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

iseq.rb:13 to_binary: wrong argument type false (expected Symbol) #378

Closed
zzak opened this issue Nov 1, 2021 · 16 comments
Closed

iseq.rb:13 to_binary: wrong argument type false (expected Symbol) #378

zzak opened this issue Nov 1, 2021 · 16 comments

Comments

@zzak
Copy link

zzak commented Nov 1, 2021

Having issues with bootsnap on a rails new --main application using ruby-dev 3.1.0:

ruby -v
ruby 3.1.0dev (2021-11-01T08:48:03Z master b474049c78) [x86_64-darwin20]

./bootsnap-e1882c5993c3/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError)
  from ./bootsnap-e1882c5993c3/lib/bootsnap/compile_cache/iseq.rb:13:in `input_to_storage'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/compile_cache/iseq.rb:30:in `fetch'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/compile_cache/iseq.rb:30:in `fetch'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/compile_cache/iseq.rb:55:in `load_iseq'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/load_path_cache/loaded_features_index.rb:100:in `register'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
  from ./bootsnap-e1882c5993c3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `require_relative'

# gemfile.rb
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.1.0"

# Use main development branch of Rails
gem "rails", github: "rails/rails", branch: "main"

# The traditional bundling and transpiling asset pipeline for Rails.
gem "sprockets-rails", ">= 2.0.0"

# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"

# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
gem "importmap-rails", ">= 0.3.4"

# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem "turbo-rails", ">= 0.7.11"

# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem "stimulus-rails", ">= 0.4.0"

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder", "~> 2.7"

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.4.4", require: false, github: "Shopify/bootsnap"

# Use Sass to process CSS
# gem "sassc-rails", "~> 2.1"

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

group :development, :test do
  # Start debugger with binding.b [https://github.com/ruby/debug]
  gem "debug", ">= 1.0.0", platforms: %i[ mri mingw x64_mingw ]
end

group :development do
  # Use console on exceptions pages [https://github.com/rails/web-console]
  gem "web-console", ">= 4.1.0"

  # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
  # gem "rack-mini-profiler", ">= 2.3.3"

  # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
  # gem "spring"
end

group :test do
  # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
  gem "capybara", ">= 3.26"
  gem "selenium-webdriver", ">= 4.0.0"
  gem "webdrivers"
end

The same thing happened before trying the github: "Shopify/bootsnap", just wondering if this is a known issue or I'm missing something 🤔

@casperisfine
Copy link
Contributor

Hi, @zzak, this is indeed a know issue, but with MRI: https://bugs.ruby-lang.org/issues/18250

If you are currently testing ruby-head, it's best to disable ISeq caching for now.

If somehow 3.1.0preview1 releases with this bug, I'll be releasing a new version to automatically do that: https://github.com/Shopify/bootsnap/compare/detect-ruby-3-1-dev-bug

@casperisfine
Copy link
Contributor

Actually maybe I should release it now regardless to help people who test against ruby-head.

@zzak
Copy link
Author

zzak commented Nov 2, 2021

@casperisfine Thanks for the reply! Let me try nobu's patch :)

@casperisfine
Copy link
Contributor

To be clear, we found way more issues and it's no longer a two lines change. Make sure to use the full branch: ruby/ruby#5035

@zzak
Copy link
Author

zzak commented Nov 2, 2021

@casperisfine I was able to make it at least this far using the branch, so maybe we can close this one?

Screen Shot 2021-11-02 at 18 47 36

@casperisfine
Copy link
Contributor

We can keep it open as long as the Ruby bug isn't fixed, so that other people looking for it can find it more easily.

@dgsangoma
Copy link

It looks like this bug made it into the released ruby 3.0.3:

$ ruby --version
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21]
$HOME/.rvm/gems/ruby-3.0.3/gems/bootsnap-1.9.1/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError)
	from $HOME/.rvm/gems/ruby-3.0.3/gems/bootsnap-1.9.1/lib/bootsnap/compile_cache/iseq.rb:13:in `input_to_storage'
	from $HOME/.rvm/gems/ruby-3.0.3/gems/bootsnap-1.9.1/lib/bootsnap/compile_cache/iseq.rb:30:in `fetch'
...

@casperisfine
Copy link
Contributor

😭

Ok, I'll have to ship a workaround. Thank you for letting me know.

@casperisfine
Copy link
Contributor

I pushed a 1.9.2 release that entirely disable ISeq compilation if that bug is detected.

I'll see if I can do some more finely grained workaround.

@casperisfine
Copy link
Contributor

The potential less impacting workaround: #380, I'm just worried it might cause even worse problem, so I'd like to carefully test it first.

@flanger001
Copy link

Updating to 1.9.3 helped us with this issue. Thanks!

@casperisfine
Copy link
Contributor

Welcome. I think we can close this now.

yonta added a commit to momocus/sakazuki that referenced this issue Nov 27, 2021
bundle update bootsnap

Rubyのバージョンアップにより、bootsnapがエラーする。
そのためRailsの起動ができなくなる。
bootsnap 1.9.3にて修正されている。
そのためbootsnapのバージョンを上げた。

bootsnapのIssue 378を参照
ttps://github.com/Shopify/bootsnap/issues/378
manuelpuyol pushed a commit to primer/view_components that referenced this issue Dec 2, 2021
This seems to fix CI failures when ruby 3.0.3 is installed.

I noticed the failures in this PR: #915

But I was able to reproduce the failures on a clean branch using ruby 3.0.3

Related: Shopify/bootsnap#378
ima1zumi added a commit to fjordllc/bootcamp that referenced this issue Dec 6, 2021
Ruby 3.0 にアップデートするために bootsnap 1.9.3 にアップデートする

ref: `Shopify/bootsnap#378
mami-inuzuka pushed a commit to fjordllc/bootcamp that referenced this issue Dec 8, 2021
Ruby 3.0 にアップデートするために bootsnap 1.9.3 にアップデートする

ref: `Shopify/bootsnap#378
@khandudo
Copy link

Updating to 1.9.3 helped us with this issue. Thanks!

This is one works

schneems added a commit to sharpstone/rails-jsbundling that referenced this issue Feb 10, 2022
benjaminwil added a commit to 155pod/cover_tracker that referenced this issue May 15, 2022
While upgrading, I also needed to do a `bundle update bootsnap ` because
there's a known issue where Ruby 3.0.3 and older Bootsnaps dislike each
other very much.

Shopify/bootsnap#378
marcoranieri added a commit to marcoranieri/vbc-developer that referenced this issue Jul 1, 2022
@noribang
Copy link

noribang commented Oct 2, 2022

Having problems when I run rails db:create using ruby 3.0.4.
Any suggestions?

/usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError)
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:13:in `input_to_storage'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:30:in `fetch'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:30:in `fetch'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:55:in `load_iseq'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:53:in `require_relative'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/thor-1.1.0/lib/thor.rb:1:in `<main>'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/railties-6.1.3.2/lib/rails/command.rb:7:in `<main>'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/railties-6.1.3.2/lib/rails/commands.rb:3:in `<main>'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from /home/hoon/Development/code/Mod5/002_project_phase_5/phase-5-project-alpha/bin/rails:5:in `<top (required)>'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/spring-2.1.1/lib/spring/client.rb:30:in `run'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/spring-2.1.1/bin/spring:49:in `<top (required)>'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load'
        from /usr/share/rvm/gems/ruby-3.0.4/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
        from /home/hoon/Development/code/Mod5/002_project_phase_5/phase-5-project-alpha/bin/spring:10:in `require'
        from /home/hoon/Development/code/Mod5/002_project_phase_5/phase-5-project-alpha/bin/spring:10:in `block in <top (required)>'
        from <internal:kernel>:90:in `tap'
        from /home/hoon/Development/code/Mod5/002_project_phase_5/phase-5-project-alpha/bin/spring:7:in `<top (required)>'
        from bin/rails:2:in `load'
        from bin/rails:2:in `<main>'

@casperisfine
Copy link
Contributor

Any suggestions?

Your backtrace shows that you are running bootsnap 1.7.5 and Ruby 3.0.3. You should either upgrade to Ruby 3.0.4 or bootsnap 1.9.2 (or both really).

RyanofWoods added a commit to RyanofWoods/rails-react-swedish-birds that referenced this issue Nov 26, 2022
When attempting to run the server on Ruby 3.0.4, it fails. Apparently,
some bug was released in Ruby 3.0.3 that affects Bootsnap. However,
Bootsnap released a workaround patch.

Error:
```
.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError)
```

Reference:
- Shopify/bootsnap#378
RyanofWoods added a commit to RyanofWoods/rails-react-swedish-birds that referenced this issue Nov 26, 2022
When attempting to run the server on Ruby 3.0.4, it fails. Apparently,
some bug was released in Ruby 3.0.3 that affects Bootsnap. However,
Bootsnap released a workaround patch.

Error:
```
.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.5/lib/bootsnap/compile_cache/iseq.rb:13:in `to_binary': wrong argument type false (expected Symbol) (TypeError)
```

Reference:
- Shopify/bootsnap#378
@nonanik112
Copy link

nonanik112 commented Sep 11, 2023

When I install Ruby 3.2.2, the error comes out like this, I cannot open a normal Rails new project, I need to eliminate it, but the speed decreases this time.

 => Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Fetching bootsnap 1.16.0
Installing bootsnap 1.16.0 with native extensions
Bundle complete! 14 Gemfile dependencies, 75 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
         run  bundle binstubs bundler
       rails  importmap:install
rails aborted!
Errno::ENOENT: No such file or directory - bs_fetch:open_current_file:open
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache/iseq.rb:60:in `fetch'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache/iseq.rb:60:in `fetch'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache/iseq.rb:85:in `load_iseq'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:18:in `perform'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command.rb:51:in `invoke'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
<internal:C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
<internal:C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
       rails  turbo:install stimulus:install
rails aborted!
Errno::ENOENT: No such file or directory - bs_fetch:open_current_file:open
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache/iseq.rb:60:in `fetch'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache/iseq.rb:60:in `fetch'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/compile_cache/iseq.rb:85:in `load_iseq'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands/rake/rake_command.rb:18:in `perform'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/command.rb:51:in `invoke'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/railties-7.0.8/lib/rails/commands.rb:18:in `<main>'
<internal:C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
<internal:C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
C:/Users/Metehan/.local/share/gem/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)

barmintor added a commit to cul/ldpd-dcv that referenced this issue Sep 11, 2023
barmintor added a commit to cul/ldpd-dcv that referenced this issue Sep 11, 2023
barmintor added a commit to cul/ldpd-dcv that referenced this issue Nov 6, 2023
barmintor added a commit to cul/ldpd-dcv that referenced this issue Nov 6, 2023
barmintor added a commit to cul/ldpd-dcv that referenced this issue Nov 6, 2023
- add babel-plugin-transform-react-remove-prop-types to shakapacker
- update selenium and bigdecimal, spec ruby-3.0.4
- use a fork of active-triples to permit ruby-3
- use bootsnap ~> 1.9.3 to avoid iseq bug
-- Shopify/bootsnap#378
barmintor added a commit to cul/ldpd-dcv that referenced this issue Nov 6, 2023
- add babel-plugin-transform-react-remove-prop-types to shakapacker
- update selenium and bigdecimal, spec ruby-3.0.4
- use a fork of active-triples to permit ruby-3
- use bootsnap ~> 1.9.3 to avoid iseq bug
-- Shopify/bootsnap#378
barmintor added a commit to cul/ldpd-dcv that referenced this issue Dec 6, 2023
- add babel-plugin-transform-react-remove-prop-types to shakapacker
- update selenium and bigdecimal, spec ruby-3.0.4
- use a fork of active-triples to permit ruby-3
- use bootsnap ~> 1.9.3 to avoid iseq bug
-- Shopify/bootsnap#378
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

No branches or pull requests

7 participants