aop_######## has an invalid return value, cannot cast Object type [Struct] to [string]]

Description

Trying to use the debugger on an API endpoint (with Quick/QB tracing turned off) – we’re able to log in and hit a number of endpoints, but on one of them, we get the following error:

 

The stack trace points to a wirebox.getInstance() call, but none of the stack trace refers to anything in that object. The top line of the stack trace is pointing to this:

 

When we disable cbdebugger, it works fine. I’m not sure where to start here.

Activity

Show:

Luis MajanoJanuary 30, 2024 at 9:25 AM

I just recently created this back in 2019. So after 5 years, it’s still unsolved.

Luis MajanoJanuary 30, 2024 at 9:24 AM

In this case, I don’t think I can patch anything, because the AOP mixer needs to simulate what the engine gives me so it stays compliant. However, this is a lucee bug that I believe was reported by and me years ago. Not sure of its status.

I would say, to avoid this issue on that object, don’t profile that method.

Samuel W. KnowltonJanuary 29, 2024 at 9:17 PM

Yes, that’s correct – return type metadata says it’s a string.

Luis MajanoJanuary 29, 2024 at 4:42 PM

Ok. I am guessing this is lucee and I believe this is a bug with lucee where the implicit getter is typed as string in the metadata. Do a get meta data on your object and check the metada type of the property. I am almost certain it will say string.

 

If that's the case. The issue is that the debugger is profiling object methods and their results. Either remove that for now or add the getter with the right type.

Samuel W. KnowltonJanuary 29, 2024 at 3:14 PM

getTeams() is an implicit accessor as per:

    property name="teams"         type="array";

Not sure where either a string or a struct would be coming from. It is always treated as an array.

Known Error
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Priority

Sentry

Created January 24, 2024 at 6:37 PM
Updated December 16, 2024 at 9:11 AM
Resolved December 16, 2024 at 9:11 AM