Securecookie: failed to generate random iv

Hi,
I am trying to enable gitlab pages access control but the authentication does not happen, when accessing a “pages” URL. When set to public, all works. When private or internal, auth does not happen and get a 500.

Has anyone seen sth like this?
Thank you,
Anton.

Config:
gitlab_pages[‘access_control’] = true
gitlab_pages[‘inplace_chroot’] = true
pages_external_url ‘https://domain.com
pages_nginx[‘redirect_http_to_https’] = true
pages_nginx[‘ssl_certificate’] = “cert file”
pages_nginx[‘ssl_certificate_key’] = “cert file”
Logs:

{“error”:“securecookie: error - caused by: securecookie: failed to generate random iv”,“host”:“user.domain.com”,“level”:“error”,“msg”:“Failed to save the session”,“path”:"/sitemap.xml",“state”:"",“time”:“2020-07-29T05:45:33Z”}

{“correlation_id”:"",“duration_ms”:52,“host”:“user.domain.com”,“level”:“info”,“method”:“GET”,“msg”:“access”,“pages_host”:“user.domain.com”,“pages_https”:true,“pages_project_id”:0,“proto”:“HTTP/1.0”,“referrer”:"",“remote_addr”:“207.46.13.23”,“remote_ip”:“207.46.13.23”,“status”:500,“system”:“http”,“time”:“2020-07-29T05:45:33Z”,“uri”:"/sitemap.xml",“user_agent”:“Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)”,“written_bytes”:2905}

{“host”:“projects.domain.com”,“level”:“info”,“msg”:“Receive OAuth authentication callback”,“path”:"/auth",“state”:"",“time”:“2020-07-31T06:44:01Z”}

{“error”:“securecookie: error - caused by: securecookie: failed to generate random iv”,“host”:“projects.domain.com”,“level”:“error”,“msg”:“Failed to save the session”,“path”:"/auth",“state”:"",“time”:“2020-07-31T06:44:01Z”}

{“correlation_id”:"",“duration_ms”:40,“host”:“projects.domain.com”,“level”:“info”,“method”:“GET”,“msg”:“access”,“pages_host”:“projects.domain.com”,“pages_https”:true,“pages_project_id”:0,“proto”:“HTTP/1.0”,“referrer”:"",“remote_addr”:“149.62.204.84”,“remote_ip”:“149.62.204.84”,“status”:500,“system”:“http”,“time”:“2020-07-31T06:44:01Z”,“uri”:"/auth",“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36 Edg/84.0.522.49”,“written_bytes”:2905}

{“error”:“securecookie: error - caused by: securecookie: failed to generate random iv”,“host”:“projects.domain.com”,“level”:“error”,“msg”:“Failed to save the session”,“path”:"/favicon.ico",“state”:"",“time”:“2020-07-31T06:44:01Z”}

{“correlation_id”:"",“duration_ms”:4,“host”:“projects.domain.com”,“level”:“info”,“method”:“GET”,“msg”:“access”,“pages_host”:“projects.domain.com”,“pages_https”:true,“pages_project_id”:0,“proto”:“HTTP/1.0”,“referrer”:“https://projects.domain.com/auth",“remote_addr”:“149.62.204.84”,“remote_ip”:“149.62.204.84”,“status”:500,“system”:“http”,“time”:“2020-07-31T06:44:01Z”,“uri”:"/favicon.ico",“user_agent”:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36 Edg/84.0.522.49”,“written_bytes”:2905}