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

undefined method `safe_load' for Syck:Module #1454

Open
imi56 opened this issue Apr 15, 2024 · 3 comments · May be fixed by #1455
Open

undefined method `safe_load' for Syck:Module #1454

imi56 opened this issue Apr 15, 2024 · 3 comments · May be fixed by #1455

Comments

@imi56
Copy link

imi56 commented Apr 15, 2024

Describe the bug

I have a gem 'syck', "1.4.1" gem. Everything works fine unless I add gem 'elastic-apm', "4.7.2"

Steps to reproduce

Expected behavior

Environment

  • OS:
    Docker container
  • Ruby version:
    2.4.6
  • Framework and version:
    3.2.22.5
  • APM Server version:
  • Agent version:

Additional context

Add any other context about the problem here.

  • Agent config options

    Click to expand
    replace this line with your agent config options
    remember to mask any sensitive fields like tokens
    
@estolfo
Copy link
Contributor

estolfo commented Apr 22, 2024

Hi @imi56 Thanks for reporting this, I'll take a look and have an update soon.

@estolfo
Copy link
Contributor

estolfo commented Apr 26, 2024

Hi @imi56 this is due to there being no safe_load method defined on Syck, which is the module value set to the YAML constant when the syck gem is installed. So I've changed the code to confirm that safe_load is defined before using it and then fall back to load if it's not. Just FYI, using load is discouraged due to security issues. If it's possible to use psych instead so the code can use the safe_load method, that would probably be a lot better. I've opened a draft PR, and I'm just working on now how to properly test it.

@estolfo
Copy link
Contributor

estolfo commented Apr 30, 2024

Hi @imi56 did you have a chance to check out the PR? Let me know if it's a reasonable solution for you. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants