MadAppGang / identifo

Universal authentication framework for web, created with go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Identifo Admin: Edit login types not working for email

kazemisoroush opened this issue · comments

The login with email boolean settings cannot be set to false neither from UI nor server-config.yaml file. Please find more details in this video:
https://www.loom.com/share/a3b5cfe74d66428782a2807880c715d0

Also, here is the detailed error message for UI:

PANIC: runtime error: invalid memory address or nil pointer dereference
goroutine 619 [running]:
github.com/urfave/negroni.(*Recovery).ServeHTTP.func1(0x7fae7b9deb38, 0xc000010040, 0xc00017c320, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/recovery.go:159 +0xd2
panic(0x10355c0, 0x1a725e0)
	/usr/local/go/src/runtime/panic.go:965 +0x1b9
github.com/madappgang/identifo/web/admin.(*Router).UpdateLoginSettings.func1(0x7fae7b9deb38, 0xc000010058, 0xc00067ad00)
	/go/src/github.com/madappgang/identifo/web/admin/settings.go:232 +0xb4
net/http.HandlerFunc.ServeHTTP(0xc000806070, 0x7fae7b9deb38, 0xc000010058, 0xc00067ad00)
	/usr/local/go/src/net/http/server.go:2049 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00026a840, 0x7fae7b9deb38, 0xc000010058, 0xc00067ab00)
	/go/pkg/mod/github.com/gorilla/mux@v1.7.3/mux.go:212 +0xd3
github.com/urfave/negroni.Wrap.func1(0x7fae7b9deb38, 0xc000010058, 0xc00067ab00, 0xc000679600)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:46 +0x4d
github.com/urfave/negroni.HandlerFunc.ServeHTTP(0xc0003cacf0, 0x7fae7b9deb38, 0xc000010058, 0xc00067ab00, 0xc000679600)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29 +0x4e
github.com/urfave/negroni.middleware.ServeHTTP(0x14145e0, 0xc0003cacf0, 0xc0003cad20, 0x7fae7b9deb38, 0xc000010058, 0xc00067ab00)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
github.com/madappgang/identifo/web/admin.(*Router).Session.func1(0x7fae7b9deb38, 0xc000010058, 0xc00067ab00, 0xc0006795a0)
	/go/src/github.com/madappgang/identifo/web/admin/middleware.go:23 +0xe6
github.com/urfave/negroni.HandlerFunc.ServeHTTP(0xc0001b7aa0, 0x7fae7b9deb38, 0xc000010058, 0xc00067ab00, 0xc0006795a0)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29 +0x4e
github.com/urfave/negroni.middleware.ServeHTTP(0x14145e0, 0xc0001b7aa0, 0xc0003cad08, 0x7fae7b9deb38, 0xc000010058, 0xc00067ab00)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
github.com/urfave/negroni.(*Negroni).ServeHTTP(0xc00082f200, 0x7fae7b9deb38, 0xc000010040, 0xc00067ab00)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:96 +0xf1
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00026a600, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900)
	/go/pkg/mod/github.com/gorilla/mux@v1.7.3/mux.go:212 +0xd3
github.com/urfave/negroni.Wrap.func1(0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc000679580)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:46 +0x4d
github.com/urfave/negroni.HandlerFunc.ServeHTTP(0xc0003cb3f8, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc000679580)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29 +0x4e
github.com/urfave/negroni.middleware.ServeHTTP(0x14145e0, 0xc0003cb3f8, 0xc0003cb488, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
github.com/rs/cors.(*Cors).ServeHTTP(0xc000299860, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc000679560)
	/go/pkg/mod/github.com/rs/cors@v1.6.0/cors.go:240 +0x18f
github.com/urfave/negroni.middleware.ServeHTTP(0x1412c20, 0xc000299860, 0xc0003cb470, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
net/http.HandlerFunc.ServeHTTP(...)
	/usr/local/go/src/net/http/server.go:2049
github.com/madappgang/identifo/web/admin.(*Router).RemoveTrailingSlash.func1(0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc000679540)
	/go/src/github.com/madappgang/identifo/web/admin/middleware.go:86 +0x82
github.com/urfave/negroni.HandlerFunc.ServeHTTP(0x11d5938, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc000679540)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29 +0x4e
github.com/urfave/negroni.middleware.ServeHTTP(0x14145e0, 0x11d5938, 0xc0003cb458, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
github.com/urfave/negroni.(*Static).ServeHTTP(0xc00016d0b0, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc000679520)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/static.go:34 +0x7c
github.com/urfave/negroni.middleware.ServeHTTP(0x1412cc0, 0xc00016d0b0, 0xc0003cb440, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
github.com/urfave/negroni.(*Logger).ServeHTTP(0xc00016c960, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc000679500)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/logger.go:62 +0x8a
github.com/urfave/negroni.middleware.ServeHTTP(0x1412c60, 0xc00016c960, 0xc0003cb428, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
github.com/urfave/negroni.(*Recovery).ServeHTTP(0xc00017c320, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900, 0xc0006794e0)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/recovery.go:193 +0x8c
github.com/urfave/negroni.middleware.ServeHTTP(0x1412ca0, 0xc00017c320, 0xc0003cb410, 0x7fae7b9deb38, 0xc000010040, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38 +0x9c
github.com/urfave/negroni.(*Negroni).ServeHTTP(0xc00016d110, 0x1423830, 0xc0001922a0, 0xc00067a900)
	/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:96 +0xf1
github.com/madappgang/identifo/web/admin.(*Router).ServeHTTP(0xc0001e8c40, 0x1423830, 0xc0001922a0, 0xc00067a900)
	/go/src/github.com/madappgang/identifo/web/admin/router.go:153 +0x4d
net/http.StripPrefix.func1(0x1423830, 0xc0001922a0, 0xc000199700)
	/usr/local/go/src/net/http/server.go:2092 +0x234
net/http.HandlerFunc.ServeHTTP(0xc0002775c0, 0x1423830, 0xc0001922a0, 0xc000199700)
	/usr/local/go/src/net/http/server.go:2049 +0x44
net/http.(*ServeMux).ServeHTTP(0xc0003f1500, 0x1423830, 0xc0001922a0, 0xc000199700)
	/usr/local/go/src/net/http/server.go:2428 +0x1ad
github.com/madappgang/identifo/web.(*Router).ServeHTTP(0xc0003cf4d0, 0x1423830, 0xc0001922a0, 0xc000199700)
	/go/src/github.com/madappgang/identifo/web/router.go:95 +0x4d
net/http.serverHandler.ServeHTTP(0xc0001b82a0, 0x1423830, 0xc0001922a0, 0xc000199700)
	/usr/local/go/src/net/http/server.go:2867 +0xa3
net/http.(*conn).serve(0xc00076a000, 0x1428620, 0xc00013ca40)
	/usr/local/go/src/net/http/server.go:1932 +0x8cd
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2993 +0x39b`

And here is the error message from helm deployment:

Error: UPGRADE FAILED: cannot patch "evergen-auth-dev" with kind Deployment:  "" is invalid: patch: Invalid value: "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{\"deployment.kubernetes.io/revision\":\"5\",\"meta.helm.sh/release-name\":\"evergen-auth-dev\",\"meta.helm.sh/release-namespace\":\"dev\"},\"creationTimestamp\":\"2021-08-16T02:19:29Z\",\"generation\":5,\"labels\":{\"app\":\"evergen-auth-dev\",\"app.kubernetes.io/managed-by\":\"Helm\"},\"managedFields\":[{\"manager\":\"Go-http-client\",\"operation\":\"Update\",\"apiVersion\":\"apps/v1\",\"time\":\"2021-08-17T07:15:47Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:annotations\":{\".\":{},\"f:meta.helm.sh/release-name\":{},\"f:meta.helm.sh/release-namespace\":{}},\"f:labels\":{\".\":{},\"f:app\":{},\"f:app.kubernetes.io/managed-by\":{}}},\"f:spec\":{\"f:progressDeadlineSeconds\":{},\"f:replicas\":{},\"f:revisionHistoryLimit\":{},\"f:selector\":{},\"f:strategy\":{\"f:rollingUpdate\":{\".\":{},\"f:maxSurge\":{},\"f:maxUnavailable\":{}},\"f:type\":{}},\"f:template\":{\"f:metadata\":{\"f:labels\":{\".\":{},\"f:app\":{}}},\"f:spec\":{\"f:containers\":{\"k:{\\\"name\\\":\\\"evergen-auth\\\"}\":{\".\":{},\"f:args\":{},\"f:command\":{},\"f:env\":{\".\":{},\"k:{\\\"name\\\":\\\"AWS_ACCESS_KEY_ID\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_SECRET_ACCESS_KEY\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"CONTAINER_IMAGE_TAG\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"IDENTIFO_ADMIN_LOGIN\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"IDENTIFO_ADMIN_PASSWORD\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"IDENTIFO_ARG\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}}},\"f:image\":{},\"f:imagePullPolicy\":{},\"f:livenessProbe\":{\".\":{},\"f:failureThreshold\":{},\"f:httpGet\":{\".\":{},\"f:path\":{},\"f:port\":{},\"f:scheme\":{}},\"f:initialDelaySeconds\":{},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:name\":{},\"f:readinessProbe\":{\".\":{},\"f:failureThreshold\":{},\"f:httpGet\":{\".\":{},\"f:path\":{},\"f:port\":{},\"f:scheme\":{}},\"f:initialDelaySeconds\":{},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:resources\":{},\"f:terminationMessagePath\":{},\"f:terminationMessagePolicy\":{},\"f:workingDir\":{}}},\"f:dnsPolicy\":{},\"f:restartPolicy\":{},\"f:schedulerName\":{},\"f:securityContext\":{},\"f:terminationGracePeriodSeconds\":{}}}}}},{\"manager\":\"kube-controller-manager\",\"operation\":\"Update\",\"apiVersion\":\"apps/v1\",\"time\":\"2021-08-17T07:16:17Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:annotations\":{\"f:deployment.kubernetes.io/revision\":{}}},\"f:status\":{\"f:availableReplicas\":{},\"f:conditions\":{\".\":{},\"k:{\\\"type\\\":\\\"Available\\\"}\":{\".\":{},\"f:lastTransitionTime\":{},\"f:lastUpdateTime\":{},\"f:message\":{},\"f:reason\":{},\"f:status\":{},\"f:type\":{}},\"k:{\\\"type\\\":\\\"Progressing\\\"}\":{\".\":{},\"f:lastTransitionTime\":{},\"f:lastUpdateTime\":{},\"f:message\":{},\"f:reason\":{},\"f:status\":{},\"f:type\":{}}},\"f:observedGeneration\":{},\"f:readyReplicas\":{},\"f:replicas\":{},\"f:updatedReplicas\":{}}}}],\"name\":\"evergen-auth-dev\",\"namespace\":\"dev\",\"resourceVersion\":\"10733074\",\"uid\":\"bf8f240f-8f03-4811-a307-c89f85b0f38d\"},\"spec\":{\"progressDeadlineSeconds\":600,\"replicas\":1,\"revisionHistoryLimit\":10,\"selector\":{\"matchLabels\":{\"app\":\"evergen-auth-dev\"}},\"strategy\":{\"type\":\"RollingUpdate\",\"rollingUpdate\":{\"maxUnavailable\":\"25%!\(MISSING)",\"maxSurge\":\"25%!\(MISSING)"}},\"template\":{\"metadata\":{\"creationTimestamp\":null,\"labels\":{\"app\":\"evergen-auth-dev\"}},\"spec\":{\"containers\":[{\"args\":[\"$(IDENTIFO_ARG)\"],\"command\":[\"./identifo\"],\"env\":[{\"name\":\"IDENTIFO_ADMIN_LOGIN\",\"value\":\"$IDENTIFO_ADMIN_PASSWORD\"},{\"name\":\"IDENTIFO_ADMIN_PASSWORD\",\"value\":\"$IDENTIFO_ADMIN_PASSWORD\"},{\"name\":\"CONTAINER_IMAGE_TAG\",\"value\":9522035},{\"name\":\"AWS_ACCESS_KEY_ID\",\"value\":\"AKIAV5O3VXQPSPTAF7IL\"},{\"name\":\"AWS_SECRET_ACCESS_KEY\",\"value\":\"$AWS_SECRET_DEV\"},{\"name\":\"IDENTIFO_ARG\",\"value\":\"--config=s3://ap-southeast-2@identifo-dev/server-config.yaml\"}],\"image\":\"madappgangd/identifo\",\"imagePullPolicy\":\"Always\",\"livenessProbe\":{\"httpGet\":{\"path\":\"/ping\",\"port\":80},\"initialDelaySeconds\":10,\"periodSeconds\":10},\"name\":\"evergen-auth\",\"readinessProbe\":{\"httpGet\":{\"path\":\"/ping\",\"port\":80},\"initialDelaySeconds\":20,\"periodSeconds\":10},\"resources\":{},\"workingDir\":\"/root\"}],\"dnsPolicy\":\"ClusterFirst\",\"restartPolicy\":\"Always\",\"schedulerName\":\"default-scheduler\",\"securityContext\":{},\"terminationGracePeriodSeconds\":30}}},\"status\":{\"observedGeneration\":5,\"replicas\":1,\"updatedReplicas\":1,\"readyReplicas\":1,\"availableReplicas\":1,\"conditions\":[{\"type\":\"Available\",\"status\":\"True\",\"lastUpdateTime\":\"2021-08-17T07:09:37Z\",\"lastTransitionTime\":\"2021-08-17T07:09:37Z\",\"reason\":\"MinimumReplicasAvailable\",\"message\":\"Deployment has minimum availability.\"},{\"type\":\"Progressing\",\"status\":\"True\",\"lastUpdateTime\":\"2021-08-17T07:16:18Z\",\"lastTransitionTime\":\"2021-08-16T02:43:52Z\",\"reason\":\"NewReplicaSetAvailable\",\"message\":\"ReplicaSet \\\"evergen-auth-dev-6f444cd59c\\\" has successfully progressed.\"}]}}": v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects " or n, but found 9, error found in #10 byte of ...|,"value":9522035},{"|..., bigger context ...|":"$IDENTIFO_ADMIN_PASSWORD"},{"name":"CONTAINER_IMAGE_TAG","value":9522035},{"name":"AWS_ACCESS_KEY_ID","value":"AKIAV|...