-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Correcting error 405 when hosting on linux distro #235
Comments
Are you using the default configuration (SQLite database and local filesystem)? I'm not sure how to best debug this... Could you try raising the Also, have you tried attaching a debugger and stepping through the code? You'll want to set a breakpoint here: https://github.com/loic-sharma/BaGet/blob/master/src/BaGet.Core.Server/Controllers/PackagePublishController.cs#L40 |
HowTo Tracing assuming that you have access to the console and that you are using a modified version of the original "appsettings.json", you can modify the following section:
The last settings enables full TRACE but onlY for the routing engine. You can do the same WITHOUT changing appsettings.json On Linux (VM or container) define a environment variable Important to know:
|
Yes. I am using mostly default settings, only changed ApiKey and Storage path. And launched via "ASPNETCORE_URLS="http://*:5000" dotnet BaGet.dll" for now. Plan was to later on was to rely on nginx reverse proxying baget. Log and settings attached below. Now sure if app startup part is required, but if needed will append to this reply. Haven't tried to debug any deeper than looking for various solutions via google. Don't know if other approach for me would be any good as I'm not familiar with C# and I tinker in code only on automation tool level and some smaller apps. appsetting.json{
"ApiKey": "derpderp",
"PackageDeletionBehavior": "Unlist",
"AllowPackageOverwrites": false,
"Database": {
"Type": "Sqlite",
"ConnectionString": "Data Source=baget.db"
},
"Storage": {
"Type": "FileSystem",
"Path": "/home/krisjanis/packages"
},
"Search": {
"Type": "Database"
},
"Mirror": {
"Enabled": false,
"PackageSource": "https://api.nuget.org/v3/index.json"
},
"Logging": {
"IncludeScopes": false,
"Debug": {
"LogLevel": {
"Default": "Debug"
}
},
"Console": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore.Routing": "Trace"
}
}
}
} web.config<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<remove name="WebDAV" />
</modules>
<aspNetCore processPath="dotnet" arguments=".\BaGet.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 284366CB-C68F-473E-908A-50A382616AE0--> debug - response to put request.
|
i had only a few minutes today...but 2 ideas: maybe the same problem like here: OR: the Method "Upload" inside the PackagePublishController has NO Http Attribute.... we should doublecheck if we should add a [HttpPut] attribute there.... BUT basically push on linux should be working, i was able to push on my demo instance (Azure Linux WebApp docker container) yesterday..... Werner |
Found my problem. Packet client for some reason when using apikey throws out this 405 error. Same thing if choco.exe (chocolatey nuget client) is used. PS D:\nuget> .\paket.exe push --url "http://192.168.122.217:5000/v3/index.json" --api-key "derpderp" winbox.3.18.2.nupkg
Paket version 5.198.0
Pushing package winbox.3.18.2.nupkg to http://192.168.122.217:5000/v3/index.json - trial 1
Could not push winbox.3.18.2.nupkg: The remote server returned an error: (405) Method Not Allowed.
Pushing package winbox.3.18.2.nupkg to http://192.168.122.217:5000/v3/index.json - trial 2
Could not push winbox.3.18.2.nupkg: The remote server returned an error: (405) Method Not Allowed.
Pushing package winbox.3.18.2.nupkg to http://192.168.122.217:5000/v3/index.json - trial 3
Could not push winbox.3.18.2.nupkg: The remote server returned an error: (405) Method Not Allowed.
Pushing package winbox.3.18.2.nupkg to http://192.168.122.217:5000/v3/index.json - trial 4
Could not push winbox.3.18.2.nupkg: The remote server returned an error: (405) Method Not Allowed.
Pushing package winbox.3.18.2.nupkg to http://192.168.122.217:5000/v3/index.json - trial 5
Performance:
- Runtime: 571 milliseconds
Paket failed with
-> WebException: The remote server returned an error: (405) Method Not Allowed. PS D:\nuget> choco.exe push winbox.3.18.2.nupkg --source "http://192.168.122.217:5000/v3/index.json" --api-key="derpderp" --force
Chocolatey v0.10.11
Attempting to push winbox.3.18.2.nupkg to http://192.168.122.217:5000/v3/index.json
Failed to process request. 'Method Not Allowed'.
The remote server returned an error: (405) Method Not Allowed.. When I push from nuget.exe with no apikey or previously saved credentials all works fine. Just need to save credentials before that or while pushing it will ask both user and password. And I couldn't find default used user value. I guess I was looking for problem in wrong direction previously. Probably I should change title of issue. As that could point some one in the future the wrong way too. |
Receiving the same error on Win10. No modifications to config. ❯ publish-module -Name PS-CoolModuleIMade -Repository TestBaGET -NuGetApiKey $apikey
Publish-PSArtifactUtility : Failed to publish module 'PS-CoolModuleIMade': 'Failed to process request. 'Method Not Allowed'.
The remote server returned an error: (405) Method Not Allowed..
'.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1227 char:17
+ Publish-PSArtifactUtility -PSModuleInfo $moduleInfo `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : FailedToPublishTheModule,Publish-PSArtifactUtility |
@Azbests It looks like you'll need to use the following command to push your package using Paket:
This is awful confusing, I've went ahead and suggested some improvements to Paket: fsprojects/Paket#3322 (comment). @arnydo I see that @tomzo figured out the issue for I'll add better instructions to BaGet's documentation and "Upload" page. |
I've improved the documentation on the Upload page, please let me know what you think! See: #247 and release v0.1.75-prerelease |
I'm having the same issue on my linux machine.
I changed the logging level and this is what it shows
which I assume points to http://localhost:50561/api/v2/package and http://localhost:50561/api/v2/symbol. Could (https://docs.microsoft.com/en-us/nuget/api/nuget-protocols) be the reason? |
I'm running into problem of server returning "405 Method now allowed" when trying to push nupgk to server. I there any way to correct this on linux hosted server? So far typical suggestions like in Issue #195 of adding more configuration in web.config file have not helped so far.
Server running on debian stretch. Tried both docker version and just running with dotnet BaGet.dll.
Any suggestions?
The text was updated successfully, but these errors were encountered: