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

Failed to read or parse configuration file at config/newrelic.yml (Psych 4.0.0+) #759

Closed
fukayatsu opened this issue Aug 30, 2021 · 4 comments · Fixed by #762
Closed

Failed to read or parse configuration file at config/newrelic.yml (Psych 4.0.0+) #759

fukayatsu opened this issue Aug 30, 2021 · 4 comments · Fixed by #762
Labels
bug community To tag external issues and PRs submitted by the community

Comments

@fukayatsu
Copy link
Contributor

newrelic_rpm can't parse configuration file with psych 4.0.0+

Description

Psych 4.0.0 makes YAML.load default to safe mode (ruby/psych#487).
This cause error on parsing config/newrelic.yml.

Expected Behavior

newrelic_rpm can parse configuration file with psych 4.0.0+

Troubleshooting or [NR Diag]

$ cat log/newrelic_agent.log

# Logfile created on 2021-08-30 11:14:57 +0900 by logger.rb/v1.4.2
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] INFO : Starting the New Relic agent version 7.2.0 in "development" environment.
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] INFO : To prevent agent startup add a NEW_RELIC_AGENT_ENABLED=false environment variable or modify the "development" section of your newrelic.yml.
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] INFO : Reading configuration from config/newrelic.yml (/***/***/fukayatsu/newrelic-with-psych-4)
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] ERROR : Failed to read or parse configuration file at config/newrelic.yml
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] ERROR : Psych::BadAlias: Unknown alias: default_settings
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] INFO : Environment: development
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] INFO : No known dispatcher detected.
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] INFO : Application: development
[2021-08-30 11:14:57 +0900 *LOCAL* (41089)] WARN : No license key found. This often means your newrelic.yml file was not found, or it lacks a section for the running environment, 'development'. You may also want to try linting your newrelic.yml to ensure it is valid YML.
[2021-08-30 11:14:58 +0900 *LOCAL* (41089)] INFO : Installing Net:HTTP Wrappers
[2021-08-30 11:14:58 +0900 *LOCAL* (41089)] INFO : Installing New Relic supported NetHTTP instrumentation using Prepend
[2021-08-30 11:14:58 +0900 *LOCAL* (41089)] INFO : Finished instrumentation

Steps to Reproduce

Your Environment

Include as many relevant details about your environment as possible including the running version of the Ruby agent, the Ruby version being used and any other relevant environment information

$ ruby -v
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-darwin20]
$ cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    newrelic_rpm (7.2.0)
    psych (4.0.1)

PLATFORMS
  x86_64-darwin-20

DEPENDENCIES
  newrelic_rpm
  psych (~> 4)

BUNDLED WITH
   2.2.22

Additional context

@fukayatsu
Copy link
Contributor Author

Additional Notes:

@tannalynn
Copy link
Contributor

Thank you for bringing this issue to our attention, @fukayatsu.

This is definitely something we will want to address as soon as we can, so we will be including a change to support this in our next release.

In the meantime, adding psych 3 to the gemfile is a good workaround for anyone on ruby versions that ship with the new version of psych.

@fukayatsu
Copy link
Contributor Author

Thank you for fixing the issue quickly!

@kaylareopelle
Copy link
Contributor

You're most welcome, @fukayatsu! This is merged into the dev branch, a work-in-progress for our upcoming 8.0.0 major release. Feel free to point your Gemfile to that branch if you'd like to incorporate the changes now. Otherwise, the release is planned for the end of September.

@angelatan2 angelatan2 added the community To tag external issues and PRs submitted by the community label Aug 31, 2021
@kford-newrelic kford-newrelic moved this to Code Complete/Done in Ruby Engineering Board Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug community To tag external issues and PRs submitted by the community
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants