Getting 403 when trying to push packages to nuget.org - visual-studio

I've been following this document on How to Publish a Package to nuget.org gallery, and I keep getting 403 forbidden.
I've done the following steps:
Browsed to my account in nuget.org.
Clicked on my name -> API Keys
Created an API key as such:
I already have a .nupkg file, so now I try:
$ nuget.exe push .\Test.1.2.3.nupkg -Source https://api.nuget.org/v3/index.json -Apikey <apikey>
And I keep getting:
Pushing Test.1.2.3.nupkg to 'https://www.nuget.org/api/v2/package'...
PUT https://www.nuget.org/api/v2/package/
Forbidden https://www.nuget.org/api/v2/package/ 2238ms
Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.).
Why is that??

The error message said "The specified API key is invalid, has expired, or does not have permission to access the specified package."
You can check this link
If you're using a valid API key that you just created, then this message indicates a naming conflict, which isn't entirely clear from the "permission" part of the error. Change the package identifier, rebuild the project, recreate the .nupkg file, and retry the push command.
Hope it can solve yout problem.

Related

Why does Github Package Registry say my token is not scoped to read packages?

I'm trying to publish a Gradle project. I have followed all the documentation provided by GitHub, but when I send the command to publish I am getting a 401 error from the server.
Execution failed for task ':publishGprPublicationToGitHubPackagesRepository'.
> Failed to publish publication 'gpr' to repository 'GitHubPackages'
> Could not GET 'https://maven.pkg.github.com/PowerInnovations/Data-Model/com/powerinnovations/data-model/0.0.1-SNAPSHOT/maven-metadata.xml'. Received status code 401 from server: Unauthorized
Upon going to the page and logging in to Github, it says:
Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:packages'], but your token has only been granted the: [''] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.
The thing is, I am already using the personal access token which I created to do this, and it does have the read packages scope enabled.
I did get a resolution from a member of Github's support.
The support person said in an email "When publishing packages, your PAT needs the repo scope as well as write access to the repo you package will be associated with."
They agreed that the response from the server, in this case, was misleading.

Fail to confirm user. 400 Bad Request - Invalid app key

im am experiencing problems with the email validation in the appcelerator platform. I have everything configured right and the email arrive in my inbox when a new user is created, but, for some reason, the link to activate the account returns: Fail to confirm user. 400 Bad Request - Invalid app key
I checked in the tiapp.xml and checked if the api keys are properly configured and everything is alright. I have no idea of how appcelerator generate this link to verify what happen. In my template uses the link below:
https://cloud.appcelerator.com/users/confirmation?key={{key}}&confirmation_token={{confirmation_token}}
What im doing wrong? =[
Seems that the documentation is wrong. Only works if the link in the template is https://platform.appcelerator.com/#/users/confirmation/{{key}}/{{confirmation_token}}
I just encountered the same issue and can confirm the bug in the documentation. The correct url is indeed
https://platform.appcelerator.com/#/users/confirmation/{{key}}/{{confirmation_token}}
I'd like to add that there is probably a similar defect in the following documentation for password reset url:
http://docs.appcelerator.com/arrowdb/latest/#!/api/Users-method-request_reset_password
The documentation says the password reset url (if using Appcelerator instead of custom website) should be
https://dashboard.appcelerator.com/#/users/confirmation/{{key}}/{{confirmation_token}}
It seems wrong (copy-paste from email confirmation url perhaps).

Unable to find the maintenance token for TeamCity in the server log

I installed TeamCity on Windows Server 2012. It has been working fine setting up a few builds. I then attempted to install some plugins by putting .zip files in the ~/.BuildServer/plugins folder. I restarted the server by cd'ing to c:\TeamCity\bin and running "runAll stop" followed by "runAll start".
Then when I go to the teamcity page for several minutes I get a "Enter the maintenance authentication token" page. It says on the page to find the maintenance token in the teamcity-server.log file (see screenshot below). I look in c:\TeamCity\logs\teamcity-server.log and it has several "super user token" and "agent authorizationtoken". I tried using these token but get an invalid maintenance token error.
So my question is where do I find the maintenance token?
Edit: This has resolved itself for me since upgrading to the latest TeamCity version. None of the suggested answers worked at the time I had this problem so that's why I am not marking anything as the accepted answer.
Please check out file teamcity-winservice.log in logs subfolder of your Teamcity.
Auth token should be here.
open cmd goto TeamCity instalation folder
C:\TeamCity\bin
type
runAll.bat stop
wait until services stoped then type
runAll.bat start
u will see current authentication token in console,.
It should be in the file teamcity-server.log which is in the logs subfolder of your TeamCity installation - look for the text "Administrator login is required from web UI using authentication token" and a long number afterwards which is your token.
Also see the docs for TeamCity Maintenance Mode.
Had the same issue it is the Superuser token you want (it will be the last line in the log unless you have tried to login - which will show in here as failures)
Along the lines of
Administrator can login from web UI using authentication token: 1234567890
/Edited so line in log file is more obviously a quote and added an example token thanks #Kleopatra,
Took me a while to find it, but it's in the file as indicated, but it's the very last line.
if you are hitting on this issue https://youtrack.jetbrains.com/issue/TW-43100 in TeamCity (v10.0.4) for IE, you may need to enable javascript and also add the url to IE trusted site list.
If you cannot find in the log, just type a random value. The web ui will inform you that entered an invalid token.
Afterwards go to the log (TeamCity/logs/teamcity-server.log) and check the last line:
[2018-03-27 17:55:20,258] WARN - jetbrains.buildServer.STARTUP - Failed maintenance authentication from IP address /86.234.23.62 with token: "6056431478480274143". Current authentication token: "6418830881320521552"
I tried restarting the Teamcity service.
I tried the runAll stop start thing.
Didn't work for me.
I rebooted then found the superuser token in TeamCity/logs/teamcity-server.log
You will find multiple super user authentication token in the file specified (TeamCity\logs\teamcity-server). You can always use the last one in the file. (if there is not one in the last line, try logon with random number, you can get an authorization failed message with the token number included and it will be added to the file)

Cruisecontrol failing after changing repository

Initially Cruisecontrol was running perfectly. We had changed from stash to github url. Upon changing we always endup with error 'CheckForModifications'. Not sure whether the credentails/url has been cached.
Error Message:
Source control operation failed: fatal: remote error: CAPTCHA required. Your stash account has been marked as requiring a CAPTCHA to be solved before you may login agin. This is typically caused by too many attempts to login with an incorrect password. The required CAPTCHA prevents your SCM client from accessing Stash until it is solved, even if you enter your password correctly.
It sounds like it is still trying to access Stash. to change the remote url, go to your working directory and use
git remote set-url origin https://github.com/user/repo.git

while installing yii2/jui package getting error

Using version ~2.0#dev for yiisoft/yii2-jui ./composer.json has been
updated Loading composer repositories with package information
Updating dependencies (including require-dev)
Could not fetch https://api.github.com/repos/jquery/jquery, enter your
GitHub credentials to go over the API rate limit A token will be
created and stored in
"C:/Users/nimmy/AppData/Roaming/Composer/auth.json", your password
will never be stored To revoke access to this token you can visit
https://github.com/settings/applications Username:
I am getting above error while I try to install yii2/jui. I want do use a datepicker. I tried to install datepicker and composer also, but I am getting the same error.
What could I try next?
You should try composer self-update. Then run update again. Keep in mind, that GitHub imposes a limit of 60 requests per hour for unauthorized user's IP!
By entering your credentials, or alternatively it may ask you for your Authorization Token (which you can generate inside GitHub and provide to composer when prompted for it), you should extend your limit to 5000 requests per hour.
If everything is done correctly, but composer keeps saying that the Authentication Token is wrong, try making a new GitHub account and try updating again providing the credentials for the new account. In the past I had a problem when an account had the wrong authorized requests counter stored by GitHub which was counting all requests as unauthorized, making new account worked like a charm, although figuring out the problem and reporting it worked also ;)

Resources