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

NuGet api v2 not completly implemented #22838

Closed
Mik4sa opened this issue Feb 9, 2023 · 3 comments · Fixed by #22855
Closed

NuGet api v2 not completly implemented #22838

Mik4sa opened this issue Feb 9, 2023 · 3 comments · Fixed by #22855

Comments

@Mik4sa
Copy link

Mik4sa commented Feb 9, 2023

Description

It seems that the NuGet v2 api isn't fully implemented. We use Ranorex Studio 10.5 which uses the NuGet version 4.6.2.5055 afaik. Inside Ranorex when I select my Gitea NuGet feed (https://*****/api/packages/*****/nuget) I get this error:

Could not connect to the feed specified at 'https://*****/api/packages/*****/nuget'. Please verify that the package source (located in the Package Manager Settings) is valid and ensure your network connectivity.

2023-02-08 16:36:22.214|DEBUG|Ranorex.Studio|System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Could not connect to the feed specified at 'https://\*\*\*\*\*/api/packages/\*\*\*\*\*/nuget'. Please verify that the package source (located in the Package Manager Settings) is valid and ensure your network connectivity. ---> System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: MethodNotAllowed
   bei System.Data.Services.Client.QueryResult.Execute()
   bei System.Data.Services.Client.DataServiceRequest.GetQuerySetCount(DataServiceContext context)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei System.Data.Services.Client.DataServiceRequest.GetQuerySetCount(DataServiceContext context)
   bei System.Data.Services.Client.DataServiceQueryProvider.ReturnSingleton[TElement](Expression expression)
   bei System.Data.Services.Client.DataServiceQueryProvider.Execute[TResult](Expression expression)
   bei NuGet.DataServiceQueryWrapper`1.<>c__DisplayClass1`1.<Execute>b__0()
   bei NuGet.DataServiceQueryWrapper`1.Execute[TResult](Func`1 action)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei NuGet.DataServiceQueryWrapper`1.Execute[TResult](Func`1 action)
   bei NuGet.DataServiceQueryWrapper`1.Execute[TResult](Expression expression)
   bei NuGet.SmartDataServiceQuery`1.Execute[TResult](Expression expression)
   bei System.Linq.Queryable.Count[TSource](IQueryable`1 source)
   bei ICSharpCode.PackageManagement.PackagesViewModel.GetFilteredPackagesBeforePagingResults(PackagesForSelectedPageQuery query)
   bei ICSharpCode.PackageManagement.PackagesViewModel.<>c__DisplayClass64_0.<CreateReadPackagesTask>b__0()
   bei System.Threading.Tasks.Task`1.InnerInvoke()
   bei System.Threading.Tasks.Task.Execute()
   --- Ende der internen Ausnahmestapelüberwachung ---
---> (Interne Ausnahme #0) System.InvalidOperationException: Could not connect to the feed specified at 'https://\*\*\*\*\*/api/packages/\*\*\*\*\*/nuget'. Please verify that the package source (located in the Package Manager Settings) is valid and ensure your network connectivity. ---> System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: MethodNotAllowed
   bei System.Data.Services.Client.QueryResult.Execute()
   bei System.Data.Services.Client.DataServiceRequest.GetQuerySetCount(DataServiceContext context)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei System.Data.Services.Client.DataServiceRequest.GetQuerySetCount(DataServiceContext context)
   bei System.Data.Services.Client.DataServiceQueryProvider.ReturnSingleton[TElement](Expression expression)
   bei System.Data.Services.Client.DataServiceQueryProvider.Execute[TResult](Expression expression)
   bei NuGet.DataServiceQueryWrapper`1.<>c__DisplayClass1`1.<Execute>b__0()
   bei NuGet.DataServiceQueryWrapper`1.Execute[TResult](Func`1 action)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei NuGet.DataServiceQueryWrapper`1.Execute[TResult](Func`1 action)
   bei NuGet.DataServiceQueryWrapper`1.Execute[TResult](Expression expression)
   bei NuGet.SmartDataServiceQuery`1.Execute[TResult](Expression expression)
   bei System.Linq.Queryable.Count[TSource](IQueryable`1 source)
   bei ICSharpCode.PackageManagement.PackagesViewModel.GetFilteredPackagesBeforePagingResults(PackagesForSelectedPageQuery query)
   bei ICSharpCode.PackageManagement.PackagesViewModel.<>c__DisplayClass64_0.<CreateReadPackagesTask>b__0()
   bei System.Threading.Tasks.Task`1.InnerInvoke()
   bei System.Threading.Tasks.Task.Execute()<---

Using fiddler I can see that Ranorex (or NuGet) is calling following urls (in that order):

  • https://*****/api/packages/*****/nuget/$metadata (works)
  • https://*****/api/packages/*****/nuget (works)
  • https://*****/api/packages/*****/nuget/Search()/$count?$filter=IsLatestVersion&$orderby=DownloadCount%20desc&searchTerm=''&targetFramework='' (error)

The last one fails with 405 Method Not Allowed which is what we see in the stacktrace above.
Using the url from above against the nuget.org instance everything works fine.

So my assumption is, that the NuGet v2 api implementation is incomplete.

@KN4CK3R Can you say anything to this? You implemented v2 afaik.

Note: no logs where written from giteas side. I used the following config:

[log]
MODE      = file
LEVEL     = debug
ROOT_PATH = D:/Gitea/log
ENABLE_SSH_LOG = true

Gitea Version

1.18.3

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

None

Screenshots

No response

Git Version

2.39.1, Wire Protocol Version 2 Enabled

Operating System

Windows Server 2016, Version 1907 (Build 14393.5648)

How are you running Gitea?

The pre-built binary from your download page: https://dl.gitea.com/gitea/1.18.3/gitea-1.18.3-gogit-windows-4.0-amd64.exe

Database

MSSQL

@KN4CK3R
Copy link
Member

KN4CK3R commented Feb 9, 2023

Yes, Search()/$count and all other .../$count endpoints are not implemented because the official NuGet client does not support/use them.

@Mik4sa
Copy link
Author

Mik4sa commented Feb 9, 2023

Is there any chance that this will be implemented anyway?

@KN4CK3R
Copy link
Member

KN4CK3R commented Feb 9, 2023 via email

lunny added a commit that referenced this issue Feb 11, 2023
Fixes #22838

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants