awslabs / aws-greengrass-labs-jupyterlab

Apache License 2.0
2 stars 1 forks source link

can't find the access token for setting new password when I look at component logs #4

Open ahmedmuzammilAI opened 1 year ago

ahmedmuzammilAI commented 1 year ago

as mentioned I checked the logs for in /greengrass/v2/logs/aws.greengrass.labs.jupyterlab.log and I get this output:

2023-07-06T11:05:37.547Z [WARN] (Copier) aws.greengrass.labs.jupyterlab: stderr. [I 2023-07-06 07:05:37.546 ServerApp] 302 GET / (::1) 3.07ms. {scriptName=services.aws.greengrass.labs.jupyterlab.lifecycle.Run.Script, serviceName=aws.greengrass.labs.jupyterlab, currentState=RUNNING}

2023-07-06T11:05:37.569Z [WARN] (Copier) aws.greengrass.labs.jupyterlab: stderr. [I 2023-07-06 07:05:37.568 LabApp] 302 GET /lab? (::1) 4.01ms. {scriptName=services.aws.greengrass.labs.jupyterlab.lifecycle.Run.Script, serviceName=aws.greengrass.labs.jupyterlab, currentState=RUNNING}

2023-07-06T11:05:43.508Z [WARN] (Copier) aws.greengrass.labs.jupyterlab: stderr. [W 2023-07-06 07:05:43.507 ServerApp] 401 POST /login?next=%2Flab%3F (::1) 4.73ms referer=http://localhost:8888/login?next=%2Flab%3F. {scriptName=services.aws.greengrass.labs.jupyterlab.lifecycle.Run.Script, serviceName=aws.greengrass.labs.jupyterlab, currentState=RUNNING}

2023-07-06T11:32:28.265Z [WARN] (Copier) aws.greengrass.labs.jupyterlab: stderr. [W 2023-07-06 07:32:28.264 ServerApp] 401 POST /login?next=%2Flab%3F (::1) 7.77ms referer=http://localhost:8888/login?next=%2Flab%3F. {scriptName=services.aws.greengrass.labs.jupyterlab.lifecycle.Run.Script, serviceName=aws.greengrass.labs.jupyterlab, currentState=RUNNING}

I have used this link http://localhost:8888/login?next=%2Flab%3F to access jupyterlab but it doesnt work it takes me to the login page itself. I also pasted this "%2Flab%3F" from logs in the token field and it says invalid credentials.

Please tell me know where the token is and what I should copy paste in the token field. Thank you.

massi-ang commented 1 year ago

Hi,

I assume you do not have set any value for PASSWORD_HASH in your deployment configuration and hence expect Jupyter Lab to generate a one-time token to access the console.

I just found an issue (#6) where if you had set a PASSWORD_HASH and then reset it, the last password would have still been used by Jupyter Lab. You can pull the latest version of the component (1.0.1) and redeploy.

I strongly suggest to set a PASSWORD_HASH so that you do not need to access the local log file to get the access token.