oarevalo / BugLogHQ

BugLogHQ is a tool to centralize the handling of automated bug reports from multiple applications. BugLogHQ provides a unified view of error messages sent from any number of applications, allowing the developer to search, graph, forward, and explore the bug reports submitted by the applications.
http://www.bugloghq.com
154 stars 67 forks source link

"Invalid data '' for CFSQLTYPE CF_SQL_NUMERIC." when trying to sign in or "The getUsername method was not found." #72

Closed leeahoward closed 10 years ago

leeahoward commented 10 years ago

Just installed BugLog for the first time. After changing the dbtype to mssql I got this error "Invalid data '' for CFSQLTYPE CF_SQL_NUMERIC." when trying to sign in. The solution was to add a record to bl_userApplication with userID=1 and applicationID=1. Maybe this should be in the sql script?

More details - I was not able to see anything, but the message(no stack trace) until I fixed the problem, so I had to dig in to the code to debug: Message: Invalid data '' for CFSQLTYPE CF_SQL_NUMERIC. Type: Database Detail: Tag Context:
I:\G\wwwroot\buglog\components\lib\dao\dbDataProvider.cfc [23] I:\G\wwwroot\buglog\components\lib\dao\DAO.cfc [31] I:\G\wwwroot\buglog\components\appFinder.cfc [42] I:\G\wwwroot\buglog\components\hq\appService.cfc [692] I:\G\wwwroot\buglog\components\hq\appService.cfc [657] I:\G\wwwroot\buglog\hq\handlers\general.cfc [452] I:\G\wwwroot\buglog\core\coreApp.cfc [210] I:\G\wwwroot\buglog\core\coreApp.cfc [95] I:\G\wwwroot\buglog\hq\index.cfm [27]

I was also seeing the following error when resetting the app:

The getUsername method was not found. Either there are no methods with the specified method name and argument types or the getUsername method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.

The error occurred in I:\G\wwwroot\buglog\hq\includes\header.cfm: line 24 Called from I:\G\wwwroot\buglog\hq\layouts\main.cfm: line 32 Called from I:\G\wwwroot\buglog\core\core.cfm: line 2 Called from I:\G\wwwroot\buglog\hq\index.cfm: line 31 22 : Settings 23 :   |   24 : #request.requestState.currentUser.getUsername()# 25 : ( Log off ) 26 :

michael-zock commented 10 years ago

Thanks! I ran into the same thing earlier but didn't have the time to look into it.

oarevalo commented 10 years ago

Hi Lee, interesting find, I'm looking at the code and just realized that this is actually a side-effect of a recent change on the datatypes of the columns in the DAO objects.

I'll be pushing a fix for this shortly, you shouldn't require a separate record on the bl_userApplication table (the reason it works is because it doesn't trigger the type mismatch in dbDataProvider.cfc)

The second error "getUsername" happens in some cases when there are errors during initialization or login, in which the app gets into a weird session state, so a part of it thinks that there is "user" object in session scope when there is not. The best way to get out of that state is to clear your cookies (discards current session)

michael-zock commented 10 years ago

Thanks!

Just wanted to drop in to confirm that this change fixed the problem on my end.