python-harborclient icon indicating copy to clipboard operation
python-harborclient copied to clipboard

Harbor CLI Issues

Open jmakanjuola opened this issue 5 years ago • 8 comments

All thoughts and suggestions are welcome.

##Issue 1: Harbor CLI

Harbor command:

harbor user-create --username test --password Testing1 --email [email protected] --realname test
 CommandError: Unable to authorize user 'admin': {"reason": "Not Allowed", "message": "<html>
 <head><title>405 Not Allowed</title></head>
 <body bgcolor="white">
 <center><h1>405 Not Allowed</h1></center>
 <hr><center>nginx/1.13.10</center>
 </body>
 </html>
 "}
harbor  --debug --insecure project-list
DEBUG (connectionpool:813) Starting new HTTPS connection (1): local:443
DEBUG (connectionpool:393) https://local:443 "POST /login HTTP/1.1" 405 174
CommandError: Unable to authorize user 'admin': {"reason": "Not Allowed", "message": "<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.13.10</center>
</body>
</html>
"}

Issue 2: Native Curl Command/Outputs

curl -X GET "https://local/api/users/current" -H "accept: application/json"

Output: { Blank}
```

```
curl -X GET "https://local/api/projects?name=test&owner=admin&page=1" -H "accept: application/json"

Outputs:  { null }
```

jmakanjuola avatar Apr 04 '19 18:04 jmakanjuola

Had the same issue running harbor with an nginx ingress. Fixed by updating https://github.com/int32bit/python-harborclient/blob/master/harborclient/client.py#L268 to self.baseurl + "c//login",

Also needed to find 'beegosessionID' and replace with 'sid' running on harbor 1.7.5. At some point the cookie name for the session id has changed.

stephenwolfe1 avatar Apr 16 '19 20:04 stephenwolfe1

@jmakanjuola facing same issue for info initial info command to?? , How did you login using admin?

mandar14 avatar May 08 '19 11:05 mandar14

been testing harborcli on the latest version of harbor, still not working sadly :( I've tried what @stephenwolfe1 suggested without the 'c' , but still not working. I'm still having the :

CommandError: Unable to authorize user 'admin': {"reason": "Method Not Allowed", "message": "<html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.15.11</center>
</body>
</html>
"}
Time: 0h:00m:03s  

This client could be really useful if we could find a way to fix it properly

xinity avatar May 27 '19 21:05 xinity

@stephenwolfe1 Could you upload your PR to fix this ? Thanks

int32bit avatar May 30 '19 09:05 int32bit

This fixed my issue, REMEMBER to add "/" in the end of your goharbor URL, while defining your alias... This can help you @xinity...

meyerbro avatar Jun 19 '19 15:06 meyerbro

@meyerbro i may have missed this tips :) let me try it soon as I'm working on a harbor implementation project :)

xinity avatar Jun 25 '19 14:06 xinity

I'm having the same issue. Harbor core is 1.7.1 Advices?

riccardomanfrin avatar Oct 22 '19 09:10 riccardomanfrin

I'm having the same issue. Harbor core is 1.7.1 Advices?

Ok.. actually the issue is with pulling. do as the README.md says: clone and build

riccardomanfrin avatar Oct 22 '19 09:10 riccardomanfrin