mokey icon indicating copy to clipboard operation
mokey copied to clipboard

Document how increase logs verbosity

Open wkihara opened this issue 6 years ago • 4 comments

Hello

Thank you for sharing this tool for us to use. Came across it on 20th Dec and so far the best fit to work with IPA server.

I have struggled with getting it working - I can reset the password - by getting it to send me an email and then using the link generated to successfully change the password, but I can't login with the new password or the previous valid password

This is the only info I can find from the logs:

Dec 21 17:06:49 mokey.eng.example.com bash[1787]: time="2018-12-21T17:06:49-05:00" level=info msg="Redirect URL" wyaf=/ Dec 21 17:06:49 mokey.eng.example.com bash[1787]: time="2018-12-21T17:06:49-05:00" level=error msg="Requested path not found" ip=192.168.11.1 path=/favicon.ico Dec 21 17:06:49 mokey.eng.example.com bash[1787]: {"time":"2018-12-21T17:06:49.340658167-05:00","level":"ERROR","prefix":"echo","file":"echo.go","line":"595","message":"code=404, message=Not Found"} Dec 21 17:07:37 mokey.eng.example.com bash[1787]: time="2018-12-21T17:07:37-05:00" level=info msg="Redirect URL" wyaf=/ Dec 21 17:07:59 mokey.eng.example.com bash[1787]: time="2018-12-21T17:07:59-05:00" level=info msg="Redirect URL" wyaf=/

You have experience like this in the past? How would I go about making mokey more verbose in order to figure what need fixing?

Regards, William

wkihara avatar Dec 27 '18 17:12 wkihara

You can turn on debug mode in mokey using the --debug flag:

./mokey -c mokey.yaml --debug server

If you installed via the rpm, this is enabled by default.

aebruno avatar Jan 09 '19 15:01 aebruno

Thanks.

Its indeed enabled. I guess its not verbose enough to assist resolve an issue I have.

I have mokey partially working - I can successfully reset the password. However, the user can't login. When once use invalid password, it throw an error that login is incorrect. However, if one use the proper password, it don't complain about a wrong credential, but just remains on /auth/login page

On the backend, this is all that I see: Jan 10 15:19:25 mars bash[15351]: time="2019-01-10T15:19:25-05:00" level=info msg="Redirect URL" wyaf=/ Jan 10 15:19:26 mars bash[15351]: time="2019-01-10T15:19:26-05:00" level=error msg="Requested path not found" ip=55.89.193.94 path=/static/css/bootstrap.min.css.map Jan 10 15:19:26 mars bash[15351]: {"time":"2019-01-10T15:19:26.468770071-05:00","level":"ERROR","prefix":"echo","file":"echo.go","line":"595","message":"code=404, message=Not Found"}

I used firefox Web developer addon, under Network tab, I don't see any 404 or 500.

Only issue show under console and this don't see to be critical Source map error: request failed with status 404 Resource URL: https://mars.external.example.com/static/css/bootstrap.min.css?v=6 Source Map URL: bootstrap.min.css.map[Learn More]

How else should I look into? Seen the problem in the past?

wkihara avatar Jan 10 '19 20:01 wkihara

hi @wkihara, just hit similar issue when setting up mokey.

About staying on signin page after a correct login. Check your configuration file and make sure that the auth_key and enc_key parameters are configured with correct length, such that mokey can setup the cookie store correctly. The related code is located in server.go

auth_key should be string with 32 / 64 characters in length enc_key should be string with 16 / 24 / 32 characters in length They should be generated with a secure random algorithm. http://www.gorillatoolkit.org/pkg/sessions

licklishh avatar Feb 19 '19 08:02 licklishh

Hi. Actually I believe it should be marked as an error (i.e. startup should fail) if auth_key / enc_key doesn't work instead of just not setting the session cookie. Because it's quite hard to debug that right ...

abamuc avatar Aug 28 '21 10:08 abamuc