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

405 Method Not Allowed #14

Closed
arnydo opened this issue Mar 21, 2019 · 4 comments
Closed

405 Method Not Allowed #14

arnydo opened this issue Mar 21, 2019 · 4 comments

Comments

@arnydo
Copy link

arnydo commented Mar 21, 2019

Hello, attempting to publish Powershell modules to Liget but receive a "405 - Method Not Allowed" error.

Has anyone else experienced this?

This is a fresh, unaltered Docker deployment of Liget..

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.0 PUT http://localhost:9011/api/v3/index.json/ multipart/form-data; boundary=---------------------------8d6ade2e1fe5cb9 8784
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
      Request finished in 0.2515ms 405 text/plain
info: Microsoft.AspNetCore.Server.Kestrel[32]
      Connection id "0HLLE04EDL5E7", Request id "0HLLE04EDL5E7:00000001": the application completed without reading the entire request body.
@tomzo
Copy link
Member

tomzo commented Mar 21, 2019

Hi,

Thanks for creating the issue.

From the very brief log you provided, there seems to be a wrong endpoint that your nuget client is using. The HTTP PUT should go to /api/v2/package as in https://github.com/ai-traders/liget/blob/master/src/LiGet/CarterModules/PackagePublishModule.cs#L39 . But your log suggests there was a put at /api/v3/index.json/ which is just wrong.

It would be nice if you provided more information on how to reproduce the bug. Specifically:

  • the client you are using to upload the module.
  • steps leading to creation of module

PS: I am leaving on vacation tomorrow so I won't be able to look at this right away.

@arnydo
Copy link
Author

arnydo commented Mar 21, 2019

I am using PowerShell.
Registered the Repo with:

Register-PSRepository -Name "TestLiget" -SourceLocation "http://localhost:9011/api/v3/index.json" -PublishLocation "http://localhost:9011/api/v3/index.json" -InstallationPolicy "Trusted"

Attempt to publish PowerShell Module with:

publish-module -Name PS-CoolModule -Repository TestLiget -NuGetApiKey $apikey -Verbose
VERBOSE: Repository details, Name = 'TestLiget', Location = 'http://localhost:9011/api/v3/index.json'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Repository details, Name = 'TestLiget', Location = 'http://localhost:9011/api/v3/index.json'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Publish Location:'http://localhost:9011/api/v3/index.json'.
VERBOSE: Module 'PS-CoolModule' was found in 'C:\Users\Me\Documents\WindowsPowerShell\Modules\PS-CoolModule'.
VERBOSE: Loading module from path 'C:\Users\Me\AppData\Local\Temp\337057159\PS-CoolModule\PS-CoolModule.psm1'.
VERBOSE: Repository details, Name = 'TestLiget', Location = 'http://localhost:9011/api/v3/index.json'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: Using the specified source names : 'TestLiget'.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'http://localhost:9011/api/v3/index.json' and PackageManagementProvider is 'NuGet'.
VERBOSE: Retry downloading 'http://localhost:9011/api/v3/index.json/FindPackagesById()?id='FoooBarr'' for '2' more times
VERBOSE: Retry downloading 'http://localhost:9011/api/v3/index.json/FindPackagesById()?id='FoooBarr'' for '1' more times
VERBOSE: Retry downloading 'http://localhost:9011/api/v3/index.json/FindPackagesById()?id='FoooBarr'' for '0' more times
VERBOSE: Total package yield:'0' for the specified package 'PS-CoolModule'.
VERBOSE: Performing the operation "Publish-Module" on target "Version '1.0' of module 'PS-CoolModule'".
Publish-PSArtifactUtility : Failed to publish module 'PS-CoolModule': 'Failed to process request. 'Method Not Allowed'.

@tomzo
Copy link
Member

tomzo commented Mar 21, 2019

Can you try with:

Register-PSRepository -Name "TestLiget" -SourceLocation "http://localhost:9011/api/v3/index.json" -PublishLocation "http://localhost:9011/api/v2/package" -InstallationPolicy "Trusted"

@arnydo
Copy link
Author

arnydo commented Mar 21, 2019

That did the trick. I appreciate the assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants