docker-gitlab
docker-gitlab copied to clipboard
gitlab not working after setting GITLAB_CONTENT_SECURITY_POLICY_DIRECTIVES_CONNECT_SRC
After setting GITLAB_CONTENT_SECURITY_POLICY_DIRECTIVES_CONNECT_SRC, gitlab cannot start.
- GITLAB_CONTENT_SECURITY_POLICY_ENABLED=true
- GITLAB_CONTENT_SECURITY_POLICY_DIRECTIVES_CONNECT_SRC="'self'"
# tried with default value
# - GITLAB_CONTENT_SECURITY_POLICY_DIRECTIVES_CONNECT_SRC="'self' http://localhost:* ws://localhost:* wss://localhost:*"
# tried with custom domain
# - GITLAB_CONTENT_SECURITY_POLICY_DIRECTIVES_CONNECT_SRC="'self' http://example.com"
There's some log in Puma output:
==> supervisor/puma.log <==
{"timestamp":"2021-08-18T10:08:39.740Z","pid":985,"message":"! Unable to load application: Psych::SyntaxError: (\u003cunknown\u003e): did not find expected key while parsing a block mapping at line 59 column 9"}
/usr/lib/ruby/2.7.0/psych.rb:456:in `parse': (<unknown>): did not find expected key while parsing a block mapping at line 59 column 9 (Psych::SyntaxError)
from /usr/lib/ruby/2.7.0/psych.rb:456:in `parse_stream'
from /usr/lib/ruby/2.7.0/psych.rb:390:in `parse'
from /usr/lib/ruby/2.7.0/psych.rb:277:in `load'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:103:in `initialize'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `new'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:60:in `instance'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:37:in `[]'
from /home/git/gitlab/config/initializers/1_settings.rb:8:in `<top (required)>'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:326:in `load'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:326:in `block in load'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:299:in `load_dependency'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:326:in `load'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/engine.rb:681:in `block in load_config_initializer'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/notifications.rb:205:in `instrument'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/engine.rb:680:in `load_config_initializer'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/engine.rb:634:in `block (2 levels) in <class:Engine>'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/engine.rb:633:in `each'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/engine.rb:633:in `block in <class:Engine>'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:32:in `instance_exec'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:32:in `run'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:61:in `block in run_initializers'
from /usr/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
from /usr/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
from /usr/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:50:in `each'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:50:in `tsort_each_child'
from /usr/lib/ruby/2.7.0/tsort.rb:415:in `call'
from /usr/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from'
from /usr/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/lib/ruby/2.7.0/tsort.rb:347:in `each'
from /usr/lib/ruby/2.7.0/tsort.rb:347:in `call'
from /usr/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
from /usr/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:60:in `run_initializers'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/application.rb:384:in `initialize!'
from /home/git/gitlab/config/environment.rb:7:in `<top (required)>'
from config.ru:5:in `require'
from config.ru:5:in `block in <main>'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/puma-5.3.2/lib/puma/configuration.rb:345:in `load_rackup'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/puma-5.3.2/lib/puma/configuration.rb:267:in `app'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/puma-5.3.2/lib/puma/runner.rb:143:in `load_and_bind'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/puma-5.3.2/lib/puma/cluster.rb:349:in `run'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/puma-5.3.2/lib/puma/launcher.rb:181:in `run'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/puma-5.3.2/lib/puma/cli.rb:80:in `run'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/puma-5.3.2/bin/puma:10:in `<top (required)>'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/bin/puma:23:in `load'
from /home/git/gitlab/vendor/bundle/ruby/2.7.0/bin/puma:23:in `<main>'
It seems there's some parsing error after GITLAB_CONTENT_SECURITY_POLICY_DIRECTIVES_CONNECT_SRC is set, anyway how to fix it or did I set GITLAB_CONTENT_SECURITY_POLICY_DIRECTIVES_CONNECT_SRC the wrong format?
I encounter the same problem, making GITLAB_CONTENT_SECURITY_POLICY_ENABLED set to false give me
CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.