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

GQL ariadne hook throws blocking error #814

Open
jollysahil opened this issue May 7, 2023 · 1 comment
Open

GQL ariadne hook throws blocking error #814

jollysahil opened this issue May 7, 2023 · 1 comment

Comments

@jollysahil
Copy link

jollysahil commented May 7, 2023

Description
Ariadne GQL execute wrapper throws an unhandled error. The same GQL operation succeeds when newrelic is disabled.

Expected Behavior

  1. There shouldn't be an error thrown
  2. Errors in wrappers should be handled and not block critical operations

Troubleshooting or NR Diag results

Traceback (most recent call last):
 File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
 rv = self.dispatch_request()
 File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
 File "/usr/local/lib/python3.10/site-packages/newrelic/hooks/framework_flask.py", line 82, in _nr_wrapper_handler_
 return wrapped(*args, **kwargs)
 File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 467, in wrapper
 resp = resource(*args, **kwargs)
 File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 107, in view
 return current_app.ensure_sync(self.dispatch_request)(**kwargs)
 File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
 resp = meth(*args, **kwargs)
 File "/app/alpha/blueprints/graphql/graphql.py", line 43, in post
 success, result = ariadne.graphql_sync(
 File "/usr/local/lib/python3.10/site-packages/newrelic/hooks/framework_ariadne.py", line 66, in wrap_graphql_sync
 return wrapped(*args, **kwargs)
 File "/usr/local/lib/python3.10/site-packages/ariadne/graphql.py", line 183, in graphql_sync
 result = execute_sync(
 File "/usr/local/lib/python3.10/site-packages/graphql/execution/execute.py", line 1082, in execute_sync
 result = execute(
 File "/usr/local/lib/python3.10/site-packages/graphql/execution/execute.py", line 1030, in execute
 result = exe_context.execute_operation(operation, root_value)
 File "/usr/local/lib/python3.10/site-packages/newrelic/hooks/framework_graphql.py", line 143, in wrap_execute_operation
 trace.deepest_path = ".".join(traverse_deepest_unique_path(fields, fragments)) or ""
 TypeError: sequence item 1: expected str instance, NoneType found

Steps to Reproduce
Not all GQL operations are failing due to this, I cannot share our specific operations

Your Environment
newrelic==8.8.0
ariadne==0.19
graphql-core==3.2.1
Flask==2.2.2

newrelic.config

files:
  "/etc/newrelic-infra.yml" :
    mode: "000644"
    owner: root
    group: root
    content: |
      license_key: <redacted>

commands:
# Create the agent’s yum repository
  "01-agent-repository":
    command: sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/amazonlinux/2/x86_64/newrelic-infra.repo
#
# Update your yum cache
  "02-update-yum-cache":
    command: yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
#
# Run the installation script
  "03-run-installation-script":
    command: sudo yum install newrelic-infra -y

newrelic.ini

distributed_tracing.enabled = true
monitor_mode = true
log_level = info
ssl = true
high_security = false
transaction_tracer.enabled = true
transaction_tracer.transaction_threshold = apdex_f
transaction_tracer.record_sql = obfuscated
transaction_tracer.stack_trace_threshold = 0.5
transaction_tracer.explain_enabled = true
transaction_tracer.explain_threshold = 0.5
error_collector.enabled = true
browser_monitoring.auto_instrument = true
thread_profiler.enabled = true

Additional context
[TIP]: # ( Add any other context about the problem here. For example, relevant community posts or support tickets. )

@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant