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

uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState #19

Closed
captn3m0 opened this issue Apr 13, 2022 · 3 comments · Fixed by #22
Closed

uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState #19

captn3m0 opened this issue Apr 13, 2022 · 3 comments · Fixed by #22

Comments

@captn3m0
Copy link

Adding require "active_support/isolated_execution_state" to the top of faraday_response_middleware.rb seems to fix it (Workaround from rails/rails#43851).

Installation using bundle, on Ruby 3.0+Linux.

ruby/3.0.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:184:in `current_thread_backend': uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError)
	from ruby/3.0.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:103:in `backend='
	from ruby/3.0.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
	from ruby/3.0.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:11:in `<top (required)>'
	from ruby/3.0.0/gems/activesupport-7.0.2.3/lib/active_support/core_ext/array/conversions.rb:3:in `require'
	from ruby/3.0.0/gems/activesupport-7.0.2.3/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/faraday_response_middleware.rb:3:in `require'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/faraday_response_middleware.rb:3:in `<top (required)>'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:12:in `require'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:12:in `block in faraday_connection'
	from ruby/3.0.0/gems/faraday-1.10.0/lib/faraday/connection.rb:91:in `initialize'
	from ruby/3.0.0/gems/faraday-1.10.0/lib/faraday.rb:120:in `new'
	from ruby/3.0.0/gems/faraday-1.10.0/lib/faraday.rb:120:in `new'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:11:in `faraday_connection'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:77:in `response'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:68:in `parsed_body'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:52:in `call'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/controllers/show_feed.rb:24:in `call'
	from ruby/3.0.0/gems/hibana-0.2.0/lib/hibana/controller.rb:13:in `call'
	from ruby/3.0.0/gems/hanami-router-2.0.0.alpha6/lib/hanami/router.rb:105:in `call'
	from ruby/3.0.0/gems/hibana-0.2.0/lib/hibana/application.rb:42:in `call'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/application.rb:21:in `call'
	from ruby/3.0.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:56:in `get_response'
	from ruby/3.0.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:32:in `call'
	from ruby/3.0.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:11:in `call'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:34:in `block in call'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:33:in `each'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:33:in `call'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:18:in `call'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/command.rb:39:in `build'
	from ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from ruby/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	from ruby/3.0.0/gems/weneedfeed-0.9.2/exe/weneedfeed:6:in `<top (required)>'
	from ruby/3.0.0/bin/weneedfeed:25:in `load'
	from ruby/3.0.0/bin/weneedfeed:25:in `<top (required)>'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:58:in `load'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli.rb:483:in `exec'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli.rb:31:in `dispatch'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/cli.rb:25:in `start'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/exe/bundle:48:in `block in <top (required)>'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/lib/bundler/friendly_errors.rb:103:in `with_friendly_errors'
	from /usr/lib/ruby/gems/3.0.0/gems/bundler-2.3.10/exe/bundle:36:in `<top (required)>'
	from /usr/sbin/bundle:25:in `load'
	from /usr/sbin/bundle:25:in `<main>'
@r7kamura
Copy link
Owner

Thanks for reporting 👍

I tried it myself and reproduced it:

$ weneedfeed build --base-url=http://example.com
/home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:184:in `current_thread_backend': uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError)
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:103:in `backend='
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/activesupport-7.0.1/lib/active_support/xml_mini.rb:11:in `<top (required)>'
        from <internal:/home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/activesupport-7.0.1/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
        from <internal:/home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/faraday_response_middleware.rb:3:in `<top (required)>'
        from <internal:/home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:12:in `block in faraday_connection'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/faraday-1.10.0/lib/faraday/connection.rb:91:in `initialize'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/faraday-1.10.0/lib/faraday.rb:120:in `new'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/faraday-1.10.0/lib/faraday.rb:120:in `new'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:11:in `faraday_connection'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:77:in `response'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:68:in `parsed_body'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:52:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/controllers/show_feed.rb:24:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/hibana-0.2.0/lib/hibana/controller.rb:13:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/hanami-router-2.0.0.alpha6/lib/hanami/router.rb:105:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/hibana-0.2.0/lib/hibana/application.rb:42:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/application.rb:21:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:56:in `get_response'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:32:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:11:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:34:in `block in call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:33:in `each'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:33:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:18:in `call'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/lib/weneedfeed/command.rb:39:in `build'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
        from /home/r7kamura/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/weneedfeed-0.9.2/exe/weneedfeed:6:in `<top (required)>'
        from /home/r7kamura/.rbenv/versions/3.0.3/bin/weneedfeed:25:in `load'
        from /home/r7kamura/.rbenv/versions/3.0.3/bin/weneedfeed:25:in `<main>'

I tried to run CI on Ruby 3.0 at this PR:

but unfortunately this problem was in untested area, so I could not detect it by CI...

@r7kamura
Copy link
Owner

Reproduced at Ruby 2.7.2, so this is not related to Ruby version, but probably Rails version (due to Rails 7?)

$ weneedfeed build --base-url=http://example.com
Traceback (most recent call last):
        39: from /home/r7kamura/.rbenv/versions/2.7.2/bin/weneedfeed:23:in `<main>'
        38: from /home/r7kamura/.rbenv/versions/2.7.2/bin/weneedfeed:23:in `load'
        37: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/exe/weneedfeed:6:in `<top (required)>'
        36: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
        35: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        34: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        33: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        32: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/command.rb:39:in `build'
        31: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:18:in `call'
        30: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:33:in `call'
        29: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:33:in `each'
        28: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/capture.rb:34:in `block in call'
        27: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:11:in `call'
        26: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:32:in `call'
        25: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-capture-0.4.0/lib/rack/capture.rb:56:in `get_response'
        24: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/application.rb:21:in `call'
        23: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/hibana-0.2.0/lib/hibana/application.rb:42:in `call'
        22: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/hanami-router-2.0.0.alpha3/lib/hanami/router.rb:92:in `call'
        21: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/hibana-0.2.0/lib/hibana/controller.rb:13:in `call'
        20: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/controllers/show_feed.rb:24:in `call'
        19: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:52:in `call'
        18: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:68:in `parsed_body'
        17: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:77:in `response'
        16: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:11:in `faraday_connection'
        15: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/faraday-1.9.3/lib/faraday.rb:118:in `new'
        14: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/faraday-1.9.3/lib/faraday.rb:118:in `new'
        13: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/faraday-1.9.3/lib/faraday/connection.rb:91:in `initialize'
        12: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/scraping.rb:12:in `block in faraday_connection'
        11: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        10: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         9: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/weneedfeed-0.9.2/lib/weneedfeed/faraday_response_middleware.rb:3:in `<top (required)>'
         8: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         7: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         6: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/core_ext/array/conversions.rb:3:in `<top (required)>'
         5: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         4: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         3: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:11:in `<top (required)>'
         2: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
         1: from /home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:103:in `backend='
/home/r7kamura/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:184:in `current_thread_backend': uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError)

@r7kamura
Copy link
Owner

Fixed at #22 and released v0.10.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.

2 participants