Chapter1: Ticket Database connection -- Error

Hi,

Can any one help on this. Or provide any material which i can go through to understand this.

I’m able to run the connection test successfully. But when i click on the localhost:5000/status it gives set of errors. Can any one help me on this.

When i check the log it shows following error:

019-02-18 14:12:21.578 ERROR 13076 — [nio-5000-exec-4] mflix.api.security.JWTAuthEntryPoint : Unauthorized error: Bad credentials
2019-02-18 14:12:21.681 ERROR 13076 — [nio-5000-exec-3] Service$$EnhancerBySpringCGLIB$$e52cafec : Cannot validate user token Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjIxNzI3NzMsIm5iZiI6MTUyMjE3Mjc3MywianRpIjoiYjFlYmI0ZDQtNjZlZS00MTY4LTg0MWQtZGNhODJkMThmN2NhIiwiZXhwIjoxNTIyMTczNjczLCJpZGVudGl0eSI6eyJlbWFpbCI6ImZvb2JhekBiYXIuY29tIiwibmFtZSI6ImZvbyBiYXIiLCJwYXNzd29yZCI6bnVsbCwicHJlZmVyZW5jZXMiOnsiZmF2b3JpdGVfY2FzdCI6Ik1lZyBSeWFuIiwicHJlZmVycmVkX2xhbmd1YWdlIjoiRW5nbGlzaCJ9fSwiZnJlc2giOmZhbHNlLCJ0eXBlIjoiYWNjZXNzIiwidXNlcl9jbGFpbXMiOnsidXNlciI6eyJlbWFpbCI6ImZvb2JhekBiYXIuY29tIiwibmFtZSI6ImZvbyBiYXIiLCJwYXNzd29yZCI6bnVsbCwicHJlZmVyZW5jZXMiOnsiZmF2b3JpdGVfY2FzdCI6Ik1lZyBSeWFuIiwicHJlZmVycmVkX2xhbmd1YWdlIjoiRW5nbGlzaCJ9fX19.q9z_tG7gEqaRMfrbTpj9Jz52vocqOBWgEpCd3KC6giI: error thrown - JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.
2019-02-18 14:12:21.683 ERROR 13076 — [nio-5000-exec-3] mflix.api.security.JWTAuthEntryPoint : Unauthorized error: Full authentication is required to access this resource
2019-02-18 14:12:21.701 ERROR 13076 — [io-5000-exec-10] Service$$EnhancerBySpringCGLIB$$e52cafec : Cannot validate user token Bearer undefined: error thrown - JWT strings must contain exactly 2 period characters. Found: 0

I got the issue and fixed it. Now connection test is working fine in the Status tab also.

how did you fix the error

enter localhost:5000 in the browser. Then, on that page, you will see Status button and press that

1 Like

it gave the same error
“return from the api was incorrect”

JWT strings must contain exactly 2 period characters. Found: 0

Hi @Torryola01,

What do you mean by “JWT strings must contain exactly 2 period characters. Found: 0”?
Do we need to change it? Thanks!

Wendy, is your connection test work before starting the application?
If yes then verify the Unit test case and provide proper connection details in the application.properties file.
for this test JWT is not used. you can try debug mode to find the exact step it fails.

I modified the unit test expected value by mistake which created the issue. JWT string dont have impact on the connection test. i left the JWT value same as default value which was given.

Is their a reason why the direct page did not work?

Hi
The connection Test passed, still getting “Connection: The return from the api was incorrect”. Can you please help on this.

Hi I am facing the same issue. Also the Connection Test unit test case is failing as expected value is not matching ,not sure why ?

@Shreeyash_79069, make sure you are setting the correct URI in the src/resources/application.properties file.

N.

@Norberto Thanks for your input .The problem is fixed for me ,just had to correct the URI in application.properties file and import the data again .

1 Like

If you run mflix app for first time direct link localhost:port/status (port by default 5000) actually don’t work. The remedy is load main page aka localhost:port and click Status button.

2 Likes