How to resolve Github Nuget Packages Error 500? - github

I have packages in my private GitHub account as well as in that of my organisation, which I have always used. Now I wanted to add new to them, so I created a new PAT and tried it out a bit. But now I have the problem that my packages can no longer be accessed. I can access the link:
https://nuget.pkg.github.com/%5BNAME%5D/index.json
but when I try to add this in Visual Studio I get the error message: “Failed to retrieve metadata from source ‘https://nuget.pkg.github.com/%5BNAME%5D/query?q=&skip=0&take=26&prerelease=false&supportedFramework=.NETFramework,Version=v4.8&semVerLevel=2.0.0%E2%80%99.
Response status code does not indicate success: 500 (Internal Server Error).” When I call the link I get the text: {“error”: “The GitHub Packages service encountered an error.”} . Can anyone help me?
PAT has the rights to all repos, as well as write and delete packages.
I have tried deleting all the packages and uploading them again, I have created a PAT with all the permissions and tried this from different PCs on different networks.

Created a Ticket https://support.github.com/
It seems to be a bug with GitHub itself. They've been working on it for almost a month now.

Related

I am trying to get vscode extension gitlab workflow to connect, but get invalid url error

When I launch VSCode with the GitLab workflow extension, I get this error message:
Invalid URL: git#gitlab.com:#####/######.git/
(I have removed address with #).
If I right click and open folder in terminal, I can git push.
When I set up extension, I accepted the GitLab instance and pasted my personal access token.
Do you think I cloned the wrong URL?
This is about GitLab VS Code Extension, code at gitlab-org/gitlab-vscode-extension
First, you should not paste a token for an SSH URL: a token is only used as password for HTTPS URL.
Second, this is followed by gitlab-org/gitlab-vscode-extension issue 385 (initially about HTTPS URL, but with questions around SSH URL as well)
It recommends:
checking the gitlab.instanceUrl setting, or the presence of instanceUrl in your VS Code settings.json.
reviewing the extension logs (CMD+SHIFT+P and enter GitLab: Show extension logs command)
trying to start the VS Code editor, but make sure that the GitLab sidebar is hidden during the start (make sure that you are on, for example, the "explorer" tab when you are closing the VS Code editor so it will start on the "explorer" tab): just to avoid any extension initialization bug.
The error:
[info]: Found gitlab.com in the PAT list and git remotes, using it as the instanceUrl
was seen in gitlab-org/gitlab-vscode-extension issue 307.
And lead to issue 281.
I suggest telling it clearly on the readme to avoid group name in the URL configuration as it is taken from the workspace name.
Note that GitLab 15.0 (May 2022) offers an alternative:
Multiple account support for GitLab Workflow in VS Code
When setting up GitLab Workflow for VS Code, you must provide a token to authenticate to GitLab. This token authenticates you to your GitLab instance as a particular user for checking out code, seeing issues, reviewing merge requests, and more.
In GitLab Workflow 3.44, you can now use multiple tokens to authenticate to the same GitLab instance. This can be great for users who have both work and personal accounts, or accounts with separated duties.
We’ve also improved key storage for tokens, which will now be stored in VS Code’s SecretStorage, and is backed by your operating system keychain.
See Documentation and Issue.
And See GitLab 15.1 (June 2022) adds:
GitLab.com sign-in for GitLab Workflow for VS Code
Getting started with GitLab Workflow for VS Code has been challenging: install the extension, only to learn you needed to follow several extra steps to set the extension up properly. The most difficult aspect of getting started was generating a personal access token with the right scope and adding it to the extension.
Release v3.47.0 of GitLab Workflow now supports OAuth for GitLab.com, removing the need to manually generate a token. This is a huge step in making it easier for you to start using GitLab inside of VS Code.
See Documentation and Epic.

Troubles linking my watson studio with my github repo

I cannot find a way to link my watson studio with github repo.
I followed these steps:
in watson studio I navigate to integrations and generate an access token.
I copy the string of 40 characters and pasted it in the box.
I navigate to my projects' settings and in the "integrations" section I added the address to my repo from github.
All that done, when I try to share one of my jupyter notebooks i get the following error:
"Se ha producido un error al publicar el notebook Vuelva a intentarlo
más adelante."
in Spanish.
In english should be something like:
"An error took place while publishing your notebook. Try again later."
There is no code, no reference, just try again later. This happens since 3 weeks, renewing the keys, redoing the accounts, etc.
I don't know where to find for further clues to find the problem.
Any help will be really appreciated since having troubles in something so basic is very annoying.
Best
Ok, the issue is that github doesn't name the default branch as master anymore.
Watson Studio looks for this branch and if it doesn't find it gives the above error.
Creating a new branch named "master" and making it the default branch solved the issue.

Nuget Push always returning 404 (Not Found)

I've tried to publish a nuget package to my GitHub Packages account but in all cases I'm having the 404 error.
I've followed as requested on the GitHub's site:
nuget source Add -Name "GitHub" -Source "https://nuget.pkg.github.com/[MyAccount]/index.json" -UserName [MyUserName] -Password GH_TOKEN
It throwed me an error saying to add an api key.
So I created a Personal Access Token and set the api key:
nuget setapikey [MY_PAT_TOKEN] -Source "https://nuget.pkg.github.com/[MyAccount]/index.json"
But when trying to push again I had:
"Your request could not be authenticated by the GitHub Packages
service. Please ensure your access token is valid and has the
appropriate scopes configured."
So I created another token with the necessary scopes:
- read:packages
- write:packages
- delete:packages
- repo
I deleted the source and the api key and started the steps above again, with the new token, but I had the 404 error, saying that the source was not found.
So I've tried a lot of options... changing package name, changing source name, and a bunch of other things, but with the same result.
So I read this on the GitHub's website:
"When you publish a package, by default GitHub Packages uses the
package name to determine the GitHub repository containing the
package. For example, a package named odata-client would be published
to the OWNER/odata-client repository. If you would like to change the
repository containing the package, or publish multiple packages to the
same repository, you can include the URL to the GitHub repository in
the repository field of the package's .nuspec file."
As I'm using .NET Core 3.0 so I changed the csproj including:
<RepositoryUrl>https://nuget.pkg.github.com/[MyAccount]/Common</RepositoryUrl>
<RepositoryType>git</RepositoryType>
But this time I had a 400 (Bad Request)
And I tired some variations for the above url: ending with index.json, ending without index.json, ending with common, etc... But always have Bad Request error.
So I deleted this configurations and tryied again: 404 (Not Found)
I don't know what to do any more. There are someone that can help me with that? What am I doing wrong? It lacks some configuration?
I had same issue. For me it was wrong Repository Url in nuget package. I would advise you to check that RepositoryUrl is set and it is a valid url of existing repo.
I have been fixed the same error setting my repository URL:
<PropertyGroup>
<!--Others configurations values-->
<RepositoryUrl>https://github.com/GITUSERNAME/REPOSITORY-PATH**</RepositoryUrl>
</PropertyGroup>
I am using dotnet core and setting this configuration in .csproj
I had the same issue, my solution was to give all "Repo" permissions to the token.
PS: my Repo was private
I had the exact same issue and struggled with it alot.
I ended up using some of your pointers - adding
to my .nuspec and packed the project again.
This helped and pushing to github worked.
Please try packing your project again.

VSTS changed to DevOps, now our Nuget Packages are not authenticating. What do we do?

We are now getting:
Failed to retrieve metadata from source and Response status code does not indicate success: 401 (Unauthorized)
errors when reading packages that have always worked in the past.
We noticed that Microsoft changed to DevOps without sending us a warning so we could prepare our team for an outage of services. This is unfortunate, but any workaround would be greatly appreciated!
Things we have checked already: the URL for the packages, as shown in Connect to feed is the same in DevOps as it was in VSTS. Reloading visual studio, did nothing, and also reconnecting team services from visual studio did not help.
I should have just waited, we can all (all people on the team) access what we need now. It must have been a temporary glitch as they proceeded with their migration to devops.

Can Gitlab expose build and coverage badges to anonymous users?

We are hosting some repository on GitHub, some other on GitLab.
Sometimes, the package is published but not the source code.
We always display build status and code coverage in README.md.
Is there a way to have build and coverage badge on GitLab always accessible to anonymous?
Since release 11.4.8 of Gitlab it's not possible to expose project's Badges through a Personnal Access Token anymore. Because of the change "
Restrict Personal Access Tokens to API scope on web requests."
The commit that removed this "workaround" was published as a security fix
An ongoing issue is currently being discussed to find another solution. Let's see how it goes.
That was followed by issue 13324
It includes:
FYI, I have a workaround for this using the GitLab API.
It assumes you have created a token in GitLab for a user (Note: That "user" needn't necessarily be Human - my use case is to display a badge on a dashboard hosted on a different VM).
<img src="https://<gitlab-uri>/<namespace>/<project>/badges/<branch>/build.svg?private_token=<token>
Update Dec. 2018: This is no loger possible through a token (see Paul B.'s answer).
This is because of "Improper Enforcement of Token Scope":
The GitLab web interface was vulnerable to an authorization issue that allowed access to the web-UI as a user using their Personal Access Token (PAT) of any scope.
The issue is now mitigated in the latest release and is assigned CVE-2018-19569.
But...:
Updated: 2018-11-28: We have received reports that this change has impacted how repo files and job artifacts are downloaded for some users.
For instructions on how to do so through the API, please see our support issue.
And you also have a current workaround which repeats the API access:
It is possible to add the project avatar to the project repository with a particular filename (logo) and then this file will be used for the avatar. There is an example here:
https://gitlab.com/issue-reproduce/project-avatar-repo
You'll be able to retrieve the files through the Repository Files API:
https://docs.gitlab.com/ee/api/repository_files.html#get-file-from-repository
Example:
https://gitlab.com/api/v4/projects/issue-reproduce%2Fproject-avatar-repo/repository/files/logo.png?ref=master