-
Notifications
You must be signed in to change notification settings - Fork 117
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
Compiling native extension fails when having psych >= 5
#904
Comments
Thank you. This solved the problem for us. Ours was on Jenkins, using rvm, where psych 5.x somehow got installed, and was then secretly used to build appsignal. |
Thanks for reporting this issue, but I am unable to reproduce with the commands you provided. The error is triggered when the In Psych 5 the My best guess is that the wrong C-extension is loaded when the psych 5 gem is installed in your case. That particular scenario I have not been able to reproduce. I'm using chruby, not rvm, but my colleague using rvm can't reproduce this issue either. To only way I get this error, is by installing psych using the Was psych 5 installed using The issue itself isn't in the AppSignal gem, so I can't fix it. |
@tombruijn, for us, psych 5 gets installed because rdoc depends on it. Bundler simply tries to install the latest version. Appsignal doesn't list psych in the gemspec (because it's already installed with Ruby?) but rdoc explicitly specifies their dependency like such: s.add_dependency 'psych', '>= 4.0.0' I think that this issue can be resolved if AppSignal too could write out the dependency on psych but with an extra requirement since AppSignal appears to be incompatible with the newest version: s.add_dependency 'psych', '>= 4.0.0', '< 5.0.0' This will also stop dependabot from trying to upgrade libraries that cannot be upgraded. |
@tombruijn Sorry for the delay. Here's an example how you can reproduce the problem:
source 'https://rubygems.org'
gem 'sdoc'
gem 'appsignal', '3.2.2'
source 'https://rubygems.org'
gem 'sdoc'
gem 'appsignal', '3.3.1'
|
crap... @manuelvanrijn, you beat me to it! :P Created an repo which also can reproduces the error: https://github.com/Memoriam-tv/appsignal-ruby-test-report/actions |
For me, just having psych 5 installed breaks the appsignal installation, even when psych 5 is not part of the bundle. |
Check, @tombruijn update to 3.3.1 is failing in all our repo's because of this. |
Thanks for the extra information! I'll try some more with the test repo. We may just need to add psych as a dependency for a while then. It's on my wishlist to remove the YAML dependency. It has broken so many times before already. (Private issue for removing YAML.) |
Finally reproduced! I needed to make very sure that psych5 was installed first by bundler, which didn't always happen for some reason 🤷♂️ A better way to test this is to first bundle without AppSignal and then with AppSignal in the Gemfile. |
I can add psych as a dependency, but this causes the following:
Either would not be ideal. If I remove our YAML file parsing from the gem installation entirely, surprise! It reads YAML when we try to figure out Ruby's proxy settings, using I think this is a bug in Ruby. It looks to me it's loading the wrong psych extension and Ruby code combination. I'll try to double sure confirm this theory and write up a report and/or try to see if we can figure out the proxy setting another way and go the YAML-less route. |
But that's fine since AppSignal is actually not compatible with psych 5 @tombruijn . I agree that it's not ideal but this is the reality for the AppSignal gem in its current state. Going the YAML-less route sounds like a great idea although, in my opinion, that can be treated as a separate issue. |
Adding the dependency won't be enough, since having psych 5 installed without it being part of the bundle is enough to trigger the problem. |
You're right. It doesn't help to specify psych 4 in the bundle. This is not a fun bug. I think I'm going for the non-YAML route and remove the http proxy thing that deep down also parses some YAML. That way it will work in all scenarios, expect when you rely on the Ruby gems http proxy config, for which people can then specify the HTTP_PROXY env var as a workaround. |
Instead of writing a YAML file for every agent release, and then reading and parsing it on installation, directly write a Ruby file that can be more easily imported. This reduces our dependency on YAML library during installation. Part of #904
Instead of writing a YAML file for every agent release, and then reading and parsing it on installation, directly write a Ruby file that can be more easily imported. This reduces our dependency on YAML library during installation. Part of #904
Instead of writing a YAML file for every agent release, and then reading and parsing it on installation, directly write a Ruby file that can be more easily imported. This reduces our dependency on YAML library during installation. Part of #904 Closes appsignal/appsignal-agent#736
Instead of writing a YAML file for every agent release, and then reading and parsing it on installation, directly write a Ruby file that can be more easily imported. This reduces our dependency on YAML library during installation. Part of #904 Closes appsignal/appsignal-agent#736
Instead of writing a YAML file for every agent release, and then reading and parsing it on installation, directly write a Ruby file that can be more easily imported. This reduces our dependency on YAML library during installation. Add "stringio" import. That appears to have been loaded by the YAML require, but now needs to be required manually on Ruby 2.5 and newer. Part of #904 Closes appsignal/appsignal-agent#736
Partial fix sent in as a PR: #913 |
@tombruijn Oh, right! My "solution" only works if you have an isolated app with its own gems (like we have in our Docker setup). I completely forgot about other situations :-) |
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix. We also don't communicate that this behavior is happening with this fix. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix. We also don't communicate that this behavior is happening with this fix. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix, but we do log it in the installation report, which helps with debugging. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix, but we do log it in the installation report, which helps with debugging. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix, but we do log it in the installation report, which helps with debugging. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix, but we do log it in the installation report, which helps with debugging. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix. We also don't communicate that this behavior is happening with this fix. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix. We also don't communicate that this behavior is happening with this fix. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix. We also don't communicate that this behavior is happening with this fix. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
We got several reports in issue #904 that installing the AppSignal gem on system with Ruby < 3.2 with also the psych gem version 5 installed won't work and raise an error breaking the app installation. This related PR #913, which is also needed to fix the whole issue. This PR removes the need for YAML parsing during the installation for the extension download information. This change silences the secondary error that is triggered when we fetch the rubygems config, specified in the `.gemrc` file. This also triggers that error from within rubygems. Instead, users can use the `HTTP_PROXY` environment variable to configure the HTTP proxy. This is not an ideal fix. We also don't communicate that this behavior is happening with this fix. I suggest we report a bug report upstream as detailed in #904, so we can remove this rescue-statement.
@tijn no worries. I also forgot to mention I tested our YAML-less install on Ruby 3.2 with pysch 5 and that does work. Meaning upgrading Ruby to version 3.2 is also an option. We are compatible with psych 5, it's just that any Ruby version with version 4 in the standard library doesn't work, which is most Rubies. I've submitted another part of the fix in PR #914. The two PRs #913 and #914, when merged, should fix it. |
I've released the fix for this in AppSignal for Ruby gem 3.3.2. Only caveat: We try to read the Please try out this new version and let us know if it works or not! |
I just installed the newest gem in all our apps @tombruijn and there's no trace of this issue anymore. 👍 |
Looks good on my deploys! cheers! |
I've reported it with Ruby upstream: https://bugs.ruby-lang.org/issues/19371 |
This issue was fixed in RubyGems 3.4: rubygems/rubygems#6490 |
Timebox: 0.5 days
Describe the bug
After we've downgraded back to psych 4 compilation worked again.
To Reproduce
We are on
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [aarch64-linux-musl]
Error output:
The text was updated successfully, but these errors were encountered: