Unable to login to Minio Console POST to :9000

9.2k Views Asked by At

I recently deployed Minio stand-alone on a K0s pod. I can successfully use mc on my laptop to authenticate and create a bucket on my pod’s ip:9000.

But when I try to access the web console and login I get a POST error to ip:9000 and I am unable to login.

Would anyone know what’s causing this?

1

There are 1 best solutions below

6
On

I've just started a minio container to verify this and it fact there are two ports you need to publish which are 9000 and 9001.

You can reach the admin console on port 9001 and the API on port 9000, hence your mc command which targets port 9000 works but trying to login on port 9000 fails.

MinIO admin console on port 9001

Edit

Now that I understand the problem better thanks to your comments I've tested on my Docker what happens when you login. And in fact there is a POST request happening when clicking on Login but it's not going to port 9001 not 9000, so it seems the your webconsole somehow issues request to the wrong port.

Here a screenshot of the Network tab in my DevTools showing the request that's being issued when I press Login. Chrome Dev Tools: Login request

I've copied the curl for this request from the DevTool and added the -i flag so you can see the HTTP response code. You could try this with your appropriate accessKey and secretKey of course.

curl -i 'http://localhost:9001/api/v1/login'   -H 'Connection: keep-alive'   -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36'   -H 'Content-Type: application/json'   -H 'Accept: */*'   -H 'Sec-GPC: 1'   -H 'Origin: http://localhost:9001'   -H 'Sec-Fetch-Site: same-origin'   -H 'Sec-Fetch-Mode: cors'   -H 'Sec-Fetch-Dest: empty'   -H 'Referer: http://localhost:9001/login'   -H 'Accept-Language: en-US,en;q=0.9'   -H 'Cookie: PGADMIN_LANGUAGE=en'   --data-raw '{"accessKey":"minio-root-user","secretKey":"minio-root-password"}'   --compressed

Expected result:

HTTP/1.1 204 No Content
Server: MinIO Console
Set-Cookie: token=AFMyDDQmtaorbMvSfaSQs5N+/9pYgK/rartN8SrGawE3ovm9AoJ5zz/eC9tnY7fRy5k4LChYcJKvx0rWyHr/+4XN2JnqdsT6VLDGI0cTasWiOo87ggj5WEv/cK4OyFlWiv5cJA8GUgQhVmYSk7MqPCVnBlfrvXhF7FaXhy85zAvzuGnExaBv9/8vZFs2LDiDF/9RX3Skb2gzIPIKije0++q4mwllluLIrhxyGrDgO16u33fWnPMjtbmGvsaOJAjx178h19BxbVnacBFyUv7ep+TFQ3xTRFfHefIMQK9lulMZOb5/oZUgEPolZpiB1Z9IJoNHVnUDJRnIIQXjv0bti/Wkz5RnWSoFqDjUWBopqFOuWYM/GMDCVxMrXJgQ/iDSg12b0uo6sOFbtvokyccUHKp5TtEznadzMf3Ga9iiZ4WAAXqONTC4ACMGaHxgUPVD7NvlYkyOlb/dPL75q0g3Qj+hiI5FELqPLEXgXMFHAi0EQDsNo4IXeqlxTJpxQYTUXRgrx1Kg6IlRJ5P9eIKwnj/eXmvXe4lvQSXR7iwEviBa1NVl1alLP0d7eib75IfhiMo7Hvyywg==; Path=/; Expires=Sat, 26 Mar 2022 13:23:34 GMT; Max-Age=3600; HttpOnly; SameSite=Lax
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Xss-Protection: 1; mode=block
Date: Sat, 26 Mar 2022 12:23:34 GMT
Connection: close