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

No SQL dump? #44

Open
jesdynf opened this issue May 31, 2022 · 8 comments
Open

No SQL dump? #44

jesdynf opened this issue May 31, 2022 · 8 comments
Assignees
Milestone

Comments

@jesdynf
Copy link

jesdynf commented May 31, 2022

Hello,

I'm seeing a lot of "Unknown error" dumps of category "database" that are missing the SQL body or any clue about what's gone wrong with them -- is this expected behavior? Are there any changes I need to make to pick those details up?

I'm using the 1.4.0 bindings with Lucee 5.2, and forwarding the exception object onto Raygun without any manipulation. I get all of the elements but the SQL error through, the template and the stacktrace.

Thanks!

@TheRealAgentK
Copy link
Contributor

Any chance you could ping me an example/screenshot, ideally both of what's tracked in RG as well as what the cfcatch/exception looks like in a WriteDump()?

@jesdynf
Copy link
Author

jesdynf commented May 31, 2022

Example test:

<cftry>
<cfquery datasource=[redacted]>
    SELECT glarfx bo banana
</cfquery> 
<cfcatch type=any>
    <cfdump var="#cfcatch#">
    <cfset APPLICATION.raygun.send(cfcatch)> 
</cfcatch>
</cftry> 

RG response: Screenshot 2022-05-31 152853

Exception dump: Screenshot 2022-05-31 153118

@jesdynf
Copy link
Author

jesdynf commented May 31, 2022

The other Raygun tabs are uninteresting but I can provide them on request; the raw data notably doesn't have anything SQL-related in it.

@jesdynf
Copy link
Author

jesdynf commented May 31, 2022

Hmm. One last note -- the test is using the cfcatch (and displaying the negative behavior) but the actual production stuff is using the exception argument from onError, in case that somehow makes a difference. I thought it was the same exception object in both cases though.

@TheRealAgentK
Copy link
Contributor

I'll have a look at your example - from the screenshot though - the issue with "Unknown Error" is that Lucee is emitting an empty string for Message in the cfcatch variable. In this case, what would you like to see? Should maybe - if Message is empty, but Detail having a value - Detail be populated into the Raygun Message field?

The raw JSON data would be interesting too (if you don't mind posting it). If you'd rather share it privately, let me know - I'm on the CFML slack for instance.

@jesdynf
Copy link
Author

jesdynf commented May 31, 2022

That particular string is actually unimportant to me, what I need is that SQL return message under Detail because otherwise I don't have the foggiest idea what SQL is complaining about, I just know something went wrong.

@jesdynf
Copy link
Author

jesdynf commented Nov 9, 2022

A quick patch at the bottom of RaygunExceptionMethod solved it for our particular version of Lucee -- no idea if this is generally correct for all CF servers so I'm not submitting a PR.

// new code
			if (entryPoint.type == 'database') {
				if (!len(returnContent["message"])) returnContent["message"] = entryPoint.detail;
				if (Find("You have an error in your SQL syntax", returnContent["message"])) returnContent["message"] = "SQL syntax error";
				returnContent["data"] = { Error=entryPoint.Detail, Query=entryPoint.Sql };
			}

@jesdynf jesdynf closed this as completed Nov 9, 2022
@TheRealAgentK TheRealAgentK reopened this Nov 14, 2022
@TheRealAgentK
Copy link
Contributor

Reopened

Thx for the code snippet, will look into how/if that works on ACF and then PR in.

@TheRealAgentK TheRealAgentK self-assigned this Nov 14, 2022
@TheRealAgentK TheRealAgentK added this to the 1.6 milestone Nov 14, 2022
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

No branches or pull requests

2 participants