401 unauthorised when submitting release

richard.thomas86's Avatar

richard.thomas86

25 Feb, 2022 08:43 AM

My project is completing build, but fails to upload the artifacts to github. I receive the below error:
Error creating GitHub release: Error reading repository 'chummer5a/chummer5a' releases: 401 - Unauthorized

I've refreshed the oauth token and ensured that it has repo rights and what should be sufficient rights to perform the upload. I'm not sure what else can/should be done to resolve this. Project name is Chummer, github appveyor yaml is https://github.com/chummer5a/chummer5a/blob/master/appveyor.yml

  1. Support Staff 1 Posted by Feodor Fitsner on 25 Feb, 2022 04:19 PM

    Feodor Fitsner's Avatar

    So, if the value of CHUMMER_OAUTH_TOKEN variable is marked as "secure" on UI (lock sign is clicked next to it) then you could use it as the following in appveyor.yml:

      auth_token: ${CHUMMER_OAUTH_TOKEN}
    
  2. 2 Posted by richard.thomas8... on 26 Feb, 2022 01:05 AM

    richard.thomas86's Avatar

    Okay, I'm now getting
    Error creating GitHub release: Provider setting not found or it's value is empty. If secure setting is used please check that value was encrypted (or YAML was exported) while being logged under correct account.
    Parameter name: auth_token

    Should it not be marked as secure in the yaml when I do this? The value is encrypted.

  3. Support Staff 3 Posted by Feodor Fitsner on 26 Feb, 2022 03:46 AM

    Feodor Fitsner's Avatar

    On "Environment" tab of project settings put unencrypted (clear text) value of variable and then click "Lock" icon next to it. The variable will be stored in the database in encrypted form and treated as "secure" in builds.

  4. 4 Posted by richard.thomas8... on 26 Feb, 2022 06:59 AM

    richard.thomas86's Avatar

    Sorry, that still fails whether or not I use the locked variable. Did something change recently with how the keys are supposed to work? I recall getting emails about it from github that the appveyor token was old so I regenerated it and since then we've had these issues.

  5. Support Staff 5 Posted by Feodor Fitsner on 27 Feb, 2022 03:59 AM

    Feodor Fitsner's Avatar

    OK, start from putting an encrypted value to appveyor.yml:

    auth_token:
      secure: <encrypted-value>
    

    to make sure token and deployment works.

  6. 6 Posted by richard.thomas8... on 27 Feb, 2022 08:30 AM

    richard.thomas86's Avatar

    Unfortunately same behaviour using the encrypted value directly in the yaml.

  7. Support Staff 7 Posted by Feodor Fitsner on 27 Feb, 2022 06:36 PM

    Feodor Fitsner's Avatar
  8. 8 Posted by richard.thomas8... on 01 Mar, 2022 12:31 AM

    richard.thomas86's Avatar

    I've tried that; initially got an error so I generated a new token, which
    is able to access the releases api. Unfortunately

  9. 9 Posted by richard.thomas8... on 01 Mar, 2022 12:31 AM

    richard.thomas86's Avatar

    Unfortunately it still fails. Apologies for double-message.

  10. Support Staff 10 Posted by Feodor Fitsner on 01 Mar, 2022 04:01 AM

    Feodor Fitsner's Avatar

    OK, make sure you encrypt the token under the same AppVeyor account which uses it.

  11. Feodor Fitsner closed this discussion on 01 May, 2022 09:01 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac