-
Notifications
You must be signed in to change notification settings - Fork 374
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
[BUG] CLI (and API) is broken when used with "Personal access tokens" #622
Comments
Hey @fprochazka I just tested this out and was able to use a personal access token to run Is the account you are creating the personal access token under a user of the sites you are trying to operate on? The token generated from the I've opened an issue to make the API error messages more developer friendly. netlify/js-client#84 |
I've ended up using the oauth token from my local machine, but I'm not sure if that's ideal.
Well... I'm not sure I understand... I have an account... I've created a personal token under that account... Then I've tried to list sites with I don't actually need to list the sites, I'm trying to deploy from Gitlab-CI. The It looks like you're a netlify developer? Maybe your account is different? My account Would it be better if I raise this directly with Netlify support? |
It looks like the token is expired or malformed in the requests. This could very well be an issue with the underlying netlify API. Can you try to create a new personal access token and run a GET request against The token generated by the CLI will also work in the CI context |
I've created a new token, used it like this I can no longer reproduce the problem... There must have been something wrong with the tokens I've created yesterday, but I have no way to debug that now. Thanks for your help! |
Short reproduce
I'm unable to use netlify-cli (or API for that matter) with "Personal access token" - all commands end with error.
npm install netlify-cli -g
NETLIFY_AUTH_TOKEN=secret-token netlify sites:list
environment:
status:
api:
all my attempts end with
which I had to find out using direct API calls and the netlify-cli did not tell me that, instead, all got was a cryptic "Unexpected end of JSON input"
When I run
netlify login
and use the oauth workflow of opening browser and confirming the login, all the netlify-cli commands work as expected. Which is obviously not what I would want to do in CI.Full reproduce
I'm trying to integrate netlify-cli into our Gitlab-CI build (gitlab and runners are on-premises).
I've created a custom docker image
node-js/netlify-cli:2-alpine
, built like this:This image is then used to run netlify tasks.
the job is configured with
NETLIFY_SITE_ID
andNETLIFY_AUTH_TOKEN
ENV variablesThe text was updated successfully, but these errors were encountered: