goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.7k stars 4.73k forks source link

Harbor UI admin用户登陆401 #3418

Closed Colstuwjx closed 6 years ago

Colstuwjx commented 6 years ago

1)Version of docker engine and docker-compose.

Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:04:27 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:04:27 2017
 OS/Arch:      linux/amd64
 Experimental: false
docker-compose version 1.15.0, build e12f3b9

2)Config files of harbor, you can get them by packaging "harbor.cfg" and files in the same directory, including subdirectory.

3)Log files, you can get them by package the /var/log/harbor/ .

Oct 20 17:43:44 172.17.0.1 ui[6066]: 2017/11/20 09:43:44 #033[1;34m[router.go:829][D] | POST       | /login                                   | 8.208231ms       | match      | /login                                   | #033[0m
Oct 20 17:43:44 172.17.0.1 ui[6066]: 2017-10-20T09:43:44Z [DEBUG] [security.go:283]: user information is nil
Oct 20 17:43:44 172.17.0.1 ui[6066]: 2017-10-20T09:43:44Z [DEBUG] [security.go:296]: using local database project manager
Oct 20 17:43:44 172.17.0.1 ui[6066]: 2017-10-20T09:43:44Z [DEBUG] [security.go:298]: creating local database security context...
Oct 20 17:43:44 172.17.0.1 ui[6066]: 2017-10-20T09:43:44Z [INFO] unauthorized
Oct 20 17:43:44 172.17.0.1 ui[6066]: 2017/11/20 09:43:44 #033[1;34m[router.go:829][D] | GET        | /api/users/current                       | 202.576µs        | match      | /api/users/:id                           | #033[0m

烦请帮忙看看,谢谢。

ywk253100 commented 6 years ago

Try to restart Harbor, login again and package all logs.

Colstuwjx commented 6 years ago

Here are the harbor log:

log.zip

And the harbor installed version is v1.2.0. BTW, incorrect passwd will show Invalid user name or password. in ui, and correct passwd shows nothing, and login button would be disabled.

ywk253100 commented 6 years ago

Do you disable the cookie in your browser?

ywk253100 commented 6 years ago

According to the logs of proxy:

Oct 23 17:22:20 172.17.0.1 proxy[6066]: 172.18.20.67 - "POST /login HTTP/1.1" 200 0 "http://shylf-harbor.bilibili.co/harbor/sign-in" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" 0.006 0.006 .
Oct 23 17:22:20 172.17.0.1 proxy[6066]: 172.18.20.67 - "GET /api/users/current HTTP/1.1" 401 1 "http://shylf-harbor.bilibili.co/harbor/sign-in" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" 0.001 0.001 .

The POST /login got 200. But the GET /api/users/current got 401.

Colstuwjx commented 6 years ago

Thanks, I will confirm whether there is any issue on gateway.

mJace commented 6 years ago

@Colstuwjx Would might tell us how you solved this problem?

HelenaZheng commented 5 years ago

If you can login success through the command, but error in ui. plseas try to clean your autocache in your browser.