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 login to security database does not return meaningful error message. [JDBC171] #215

Closed
firebird-automations opened this issue Apr 28, 2011 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: @reevespaul

Assigned to: Roman Rokytskyy (rrokytskyy)

This code (roughly similar to code in the test units)

    try \{
      UserManager userManager = new FBUserManager\(\);
      userManager\.setHost \("localhost"\);
      userManager\.setPort \(3050\);
      userManager\.setUser \("SYSDBA"\);
      userManager\.setPassword \("masterkey"\);

      User user = new FBUser \(\);
      user\. setUserName \("TESTUSER"\);
      user\. setPassword \("123"\);
      user\. setFirstName \("John"\);
      user\. setMiddleName \("W"\);
      user\. setLastName \("Doe"\);

      userManager\.add\(user\);

    \} catch \(Exception e\) \{
        e\.printStackTrace\(\);
    \}

will fail if the SYSDBA pw is incorrect. (That's good.)

Unfortunately this is the stack trace:

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 152. No message for code 152 found.
at org.firebirdsql.management.FBUserManager.userAction(FBUserManager.java:240)
at org.firebirdsql.management.FBUserManager.add(FBUserManager.java:254)
at testjbuser.Main.main(Main.java:33)
at org.firebirdsql.gds.GDSException: No message for code 152 found.
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2791)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2743)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscServiceAttach(AbstractJavaGDSImpl.java:2709)
at org.firebirdsql.management.FBServiceManager.attachServiceManager(FBServiceManager.java:207)
at org.firebirdsql.management.FBUserManager.userAction(FBUserManager.java:228)
at org.firebirdsql.management.FBUserManager.add(FBUserManager.java:254)
at testjbuser.Main.main(Main.java:33)

In fact, it should get mapped thus:

{335544472, "Your user name and password are not defined. Ask your database administrator to set up a Firebird login."}, /* 152, login */

JayBird certainly knows about this error code because it successfully retrieves the correct message if login to a normal database fails.

@firebird-automations
Copy link
Author

Commented by: Roman Rokytskyy (rrokytskyy)

I need to check how FB returns the error code for the services... I suspect that it returns 152 for the services call and 335544472 for a normal API call. I wonder if that is correct...

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.2 [ 10053 ]

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

timeestimate: 0 [ 0 ]

timeoriginalestimate: 0 [ 0 ]

@firebird-automations
Copy link
Author

Commented by: Roman Rokytskyy (rrokytskyy)

Hmmm... either it was fixed in HEAD or something different causes that correct error message is displayed. And I see that server sends the correct error code, not the 152 one...

Please re-open the ticket, when it happens with 2.2 version.

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

status: Open [ 1 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

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