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

can not get user information from session / user information is nil #166

Closed
CorentinDy opened this issue Feb 20, 2019 · 14 comments
Closed

Comments

@CorentinDy
Copy link

CorentinDy commented Feb 20, 2019

Hi ,
I've started a new fresh install with helm but every time i get this message.
The harbor configuration is as is in the repo, I didn't made any changes.

As mentionned : #75 (comment)

  • All the pods a running
  • Here are the logs from the browser
    image
  • I'm exposing with Ingress as the stock config file
  • not sure how I can get logs from ingress

But the core log always says can not get user information from session or user information is nil and i can't login on the harbor portal.

Edit : I've tried with custom configuration :

  • external postgresql ha + redis ha
  • external postgresql ha + redis

Edit 2 : I've tried with master & 1.0.0 version still the same problem

Any clues on a fix in my configuration ?
Thx

@pieterv-icloud-com
Copy link

Exact same issue, installed harbor using this helm chart without any customisations on minikube.

Getting this in the core logs:

2019-02-23T14:29:45Z [DEBUG] [security.go:280]: can not get user information from session
2019-02-23T14:29:45Z [DEBUG] [security.go:336]: user information is nil

and this in the portal logs

127.0.0.1 - - [23/Feb/2019:14:37:27 +0000] "POST /c/login HTTP/1.1" 405 576 "http://localhost:8080/harbor/sign-in" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36"

@ywk253100
Copy link
Collaborator

@CorentinDy @pieterv-icloud-com You need to check the logs of ingress controller to make sure that the POST /c/login is received by Harbor, if not, find out who sent the 405 back to the client.

@CorentinDy
Copy link
Author

I was using an "old" version (a week difference with the last commit) i've made a change on the expose type which was Ingress , switched to loadBalancer and it seems to work !

@CorentinDy
Copy link
Author

I've justed realised that I was using the dev version of your helm wich is in the master branche ..

So the problem is not solved as the same bug still occur in the 1.0.0 wich seems to be the "latest" stable.

How can i see the log of the Ingress controller ? or wich pod is supposed to be the ingress controller ?

@ywk253100
Copy link
Collaborator

How did you install the ingress controller? What ingress controller are you using? Is there some pod called ingress-controller?

@CorentinDy
Copy link
Author

I don't have any pod called ingress-controller but I've a ingress named :

kubectl get ing
NAME                HOSTS                                     ADDRESS   PORTS     AGE
hb-harbor-ingress   core.harbor.domain,notary.harbor.domain             80, 443   1h

and here are my pods :

kubectl get pods
NAME                                       READY     STATUS    RESTARTS   AGE
hb-harbor-adminserver-86c45b59f5-zw7rt     1/1       Running   1          1h
hb-harbor-chartmuseum-8469868c57-wwxgj     1/1       Running   0          1h
hb-harbor-clair-c5f6c689c-tvsvw            1/1       Running   1          1h
hb-harbor-core-bdf85bdff-h8b4s             1/1       Running   0          1h
hb-harbor-database-0                       1/1       Running   0          1h
hb-harbor-jobservice-6b94657d8b-82mfk      1/1       Running   0          1h
hb-harbor-notary-server-88b979d7-skft7     1/1       Running   0          1h
hb-harbor-notary-signer-748cd9fc66-57hd6   1/1       Running   0          1h
hb-harbor-portal-97c68995-qkgxk            1/1       Running   0          1h
hb-harbor-redis-0                          1/1       Running   0          1h
hb-harbor-registry-ff458c564-wtw9l         2/2       Running   0          1h

@ywk253100
Copy link
Collaborator

Add the --all-namespaces option: kubectl get pods --all-namespaces.
If there is no pod called ingress-controller either, then you need to ask the one who setup the K8s cluster for you.

@pieterv-icloud-com
Copy link

Finally got it running with an nginx-ingress running as a DaemonSet with some custom NodePorts. Thank you!

@CorentinDy
Copy link
Author

Get it working by merging the new load balancer service in the stable release on my computer ..

This project seems to be not suitable for production environment .

@ywk253100
Copy link
Collaborator

@pieterv-icloud-com Did you find the root cause in you env?

@tlvenn
Copy link

tlvenn commented Mar 8, 2019

Hi,

I have the same issue in the log even though I can access and log into the portal.

2019-03-08T07:02:44Z [DEBUG] [security.go:280]: can not get user information from session
2019-03-08T07:02:44Z [DEBUG] [security.go:336]: user information is nil
2019-03-08T07:02:44Z [DEBUG] [security.go:350]: using local database project manager
2019-03-08T07:02:44Z [DEBUG] [security.go:352]: creating local database security context...

This is logged every 5sec
I use traefik as ingress controller in K8 and used the chart that is on master to deploy Harbour.

@mattthehearn
Copy link

I'm seeing the same behavior as @tlvenn; I have the traefik ingress controller, but I suspect that Harbor doesn't know how to look for it and is looking for a different controller. I haven't been able to find any documentation on setting up Harbor with the Traefik ingress; is anyone familiar enough with Traefik to know how to set this up?

@artsilenkov
Copy link

artsilenkov commented May 5, 2019

@CorentinDy @pieterv-icloud-com You need to check the logs of ingress controller to make sure that the POST /c/login is received by Harbor, if not, find out who sent the 405 back to the client.

Which service should receive this request to /c/login?
Right now we have:

  • harbor-harbor-adminserver ClusterIP 10.43.161.173 80/TCP 25m
  • harbor-harbor-chartmuseum ClusterIP 10.43.215.74 80/TCP 25m
  • harbor-harbor-clair ClusterIP 10.43.208.43 6060/TCP 25m
  • harbor-harbor-core ClusterIP 10.43.211.216 80/TCP 25m
  • harbor-harbor-database ClusterIP 10.43.33.201 5432/TCP 25m
  • harbor-harbor-jobservice ClusterIP 10.43.122.97 80/TCP 25m
  • harbor-harbor-notary-server ClusterIP 10.43.218.67 4443/TCP 25m
  • harbor-harbor-notary-signer ClusterIP 10.43.43.170 7899/TCP 25m
  • harbor-harbor-portal ClusterIP 10.43.30.18 80/TCP 25m
  • harbor-harbor-redis ClusterIP 10.43.255.7 6379/TCP 25m
  • harbor-harbor-registry ClusterIP 10.43.129.144 5000/TCP,8080/TCP 25m

Could be great if you point us which service is using for auth and what exact url we need to expose and bind with.
Tried
/c/login -> harbor-harbor-core
/c/login/ -> harbor-harbor-core
/c/login -> harbor-harbor-adminserver
/c/login/ -> harbor-harbor-adminserver
/c/login -> harbor-harbor-portal
/c/login/ -> harbor-harbor-portal

With no luck.

Also
rewriteAnnotation: nginx.ingress.kubernetes.io/rewrite-target
could also break things (notary?) for those who are not using nginx ingress controller

@artsilenkov
Copy link

Ok I got this fixed more or less with haproxy ingress and 1.0.0 branch

  1. Switched to clusterIP setup instead of ingress
  2. Ingresses recreated manually as follows:
    harbor.domain.com -> harbor-harbor-portal (80)
    harbor.domain.com/c/ -> harbor-harbor-core (8080)
    harbor.domain.com/api/ harbor-harbor-core (8080)
    harbor.domain.com/v2/ harbor-harbor-core (8080)
    harbor.domain.com/chartrepo/ harbor-harbor-chartmuseum (80)
    harbor.domain.com/service/ harbor-harbor-core (8080)

harbor core is spamming
2019-05-05T18:49:34Z [DEBUG] [security.go:233]: can not get user information from session
2019-05-05T18:49:34Z [DEBUG] [security.go:290]: user information is nil
2019-05-05T18:49:34Z [DEBUG] [security.go:304]: using local database project manager
2019-05-05T18:49:34Z [DEBUG] [security.go:306]: creating local database security context...
2019-05-05T18:49:39Z [DEBUG] [security.go:233]: can not get user information from session
2019-05-05T18:49:39Z [DEBUG] [security.go:290]: user information is nil
2019-05-05T18:49:39Z [DEBUG] [security.go:304]: using local database project manager
2019-05-05T18:49:39Z [DEBUG] [security.go:306]: creating local database security context...

But now I'm able to login and no http 500 for charts.

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

6 participants