Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Error: 401 Authorization Required #196

Closed
Rhada opened this issue Sep 23, 2022 · 8 comments · Fixed by #203
Closed

HTTP Error: 401 Authorization Required #196

Rhada opened this issue Sep 23, 2022 · 8 comments · Fixed by #203

Comments

@Rhada
Copy link

Rhada commented Sep 23, 2022

Hello,

I've a strange issue, my token is well configured but deploy task fail with 401 Auth error.

Do you've any idea ?

/action/node_modules/.bin/clever login --token *** --secret ***
/action/node_modules/.bin/clever link app_toto --alias app_toto
Your application has been successfully linked!
/action/node_modules/.bin/clever env set --alias app_toto version 1.0.0-alpha.26
Your environment variable has been successfully saved
/action/node_modules/.bin/clever deploy --alias app_toto
Error:  HTTP Error: 401 Authorization Required
Error: The process '/action/node_modules/.bin/clever' failed with exit code 1
@franky47
Copy link
Member

If you perform the same steps manually using the Clever Cloud CLI, does it work?

Do you have access to that project with that token?

@yfernane
Copy link

yfernane commented Nov 30, 2022

Hello Guys,

Actually it appears to be a problem with git get remote info, when using the CLI with verbose here is what we get :

[STACKTRACE]
HttpError: HTTP Error: 401 Authorization Required
    at GitRemoteHTTP.discover (C:\Users\lil_r\AppData\Roaming\npm\node_modules\clever-tools\node_modules\isomorphic-git\index.cjs:6760:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.getRemoteInfo (C:\Users\lil_r\AppData\Roaming\npm\node_modules\clever-tools\node_modules\isomorphic-git\index.cjs:9557:20)
    at async Object.getRemoteCommit (C:\Users\lil_r\AppData\Roaming\npm\node_modules\clever-tools\src\models\git.js:62:23)
    at async Object.deploy (C:\Users\lil_r\AppData\Roaming\npm\node_modules\clever-tools\src\commands\deploy.js:23:30) {
  caller: 'git.getRemoteInfo',
  code: 'HttpError',
  data: {
    statusCode: 401,
    statusMessage: 'Authorization Required',
    response: 'Support for password authentication was removed on August 13, 2021.\n' +
      'Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes 
of authentication.\n'
  }
}
[/STACKTRACE]
[ERROR] HTTP Error: 401 Authorization Required

@Rhada did you managed to get through your issue ?

@Spone
Copy link
Contributor

Spone commented Feb 27, 2023

Hi @franky47, same issue here.

When trying locally, I also get the 401 error:

clever login --token [REDACTED] --secret [REDACTED]
➜  project git:(main) clever deploy --alias staging                                                                  
App is brand new, no commits on remote yet
New local commit to push is 2739273d6c6d5b96d11a54f6e395df6d6c78466f (from refs/heads/main)
Pushing source code to Clever Cloud…
[ERROR] HTTP Error: 401 Authorization Required

I tried to run clever login several times, with or without arguments (using the browser to login). I'm a bit stuck. Should I contact Clever Cloud support?

@franky47
Copy link
Member

That's with the credentials found in your PR #202?

Might be worth pinging Clever Cloud support indeed, the authentication was kind of reverse-engineered on what the local CLI needed when auth'ing locally..

@Spone
Copy link
Contributor

Spone commented Feb 27, 2023

That's with the credentials found in your PR #202?

Yes.

I'm trying to figure it out with the help of Clever Cloud support. Will post here if I have an explanation!

@Spone
Copy link
Contributor

Spone commented Feb 27, 2023

The problem was that when you've created an application on Clever Cloud based on a Github repo, you can only deploy to it through the Github webhook that is automatically configured by Clever Cloud (not using a Github Action). So if you want to migrate to a Github Action, you need to create a new app (the option on the left), then you'll be able to use clever deploy (and 47ng/actions-clever-cloud) to deploy it.

image

EDIT: if you choose to migrate, don't forget to manually remove the webhook from you Github repo config!

@franky47
Copy link
Member

Thanks for reporting back, this definitely should be mentioned in the README.

Would you like to open another PR?

@Spone
Copy link
Contributor

Spone commented Feb 27, 2023

@franky47 done! Feel free to rewrite it or move it to another part of the README!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants