openfaas / faas

OpenFaaS - Serverless Functions Made Simple
https://www.openfaas.com
MIT License
24.75k stars 1.92k forks source link

Unable to log in to the gateway - connection refused #1835

Closed prateekrai1 closed 3 months ago

prateekrai1 commented 3 months ago

My actions before raising this issue

Why do you need this?

I am using OpenFaaS for my course project for my project at University of Michigan. I am trying to study the utilization of GPUs in serverless applications.

Who is this for?

This is for me. I am a student at University of Michigan.

What company is this for? Are you listed in the ADOPTERS.md file?

Expected Behaviour

Unable to login, what credentials do I give in the cli? Do I give my node username and password?

Current Behaviour

Calling the OpenFaaS server to validate the credentials... Cannot connect to OpenFaaS on URL: http://127.0.0.1:8080. Get "http://127.0.0.1:8080/system/functions": dial tcp 127.0.0.1:8080: connect: connection refused

-- I have tried using all the ways giving multiple gateways and using the environment variable too prat@node-0:~$ cat faas_password.txt | faas-cli login --username prat --password-stdin --gateway $OPENFAAS_URL Calling the OpenFaaS server to validate the credentials... Cannot connect to OpenFaaS on URL: http://127.0.0.1:31112. Get "http://127.0.0.1:31112/system/functions": dial tcp 127.0.0.1:31112: connect: connection refused

Are you a GitHub Sponsor (Yes/No?)

NO, I am not a GItHub Sponsor

Check at: https://github.com/sponsors/openfaas

List All Possible Solutions and Workarounds

Which Solution Do You Recommend?

How do I login into the CLI

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

## Your Environment
rgee0 commented 3 months ago

Provided the file you’re cat-ing contains the appropriate password then you might try admin as the username:

https://docs.openfaas.com/deployment/kubernetes/#install-openfaas-community-edition-ce-via-arkade-or-helm

If you're using faasd then there's a book that would likely help:

https://openfaas.gumroad.com/l/serverless-for-everyone-else

@alexellis sometimes makes discount codes available for academia, and over holiday periods.

prateekrai1 commented 3 months ago

cat faas_password.txt | faas-cli login --username admin --password-stdin --gateway https://127.0.0.1:8080 Calling the OpenFaaS server to validate the credentials... Cannot connect to OpenFaaS on URL: https://127.0.0.1:8080. Get "https://127.0.0.1:8080/system/functions": dial tcp 127.0.0.1:8080: connect: connection refused I tried with admin and password as admin as well, still got the connection refused

prateekrai1 commented 3 months ago

Is it better to install via arkade as I am using a remote node? After the installation you'll receive a command to retrieve your OpenFaaS URL and password. Does this statement mean arkade will set my credentials?

rgee0 commented 3 months ago

If you're using a remote node then 127.0.0.1 isn't usually going to be correct. You will need to specify the gateway in the login command, or set the CLI env var for the gateway.

I'm not sure why you are guessing the password. You are provided with the password for the gateway when you install, or if you're using k8s then you can retrieve it as per the command in the documentation.

This kind of conversation demonstrates why the template exists. It's really difficult for someone else to help when information drips into an issue.

rgee0 commented 3 months ago

/set title: Unable to log in to the gateway - connection refused

prateekrai1 commented 3 months ago

Was able to connect to the gateway after going through the documentation. Thank you.

alexellis commented 3 months ago

"Was able to connect to the gateway after going through the documentation."

👏 great!

alexellis commented 3 months ago

/lock: not an issue.