PrepareUntrackedUploads PostgreSQL syntax error
Summary
Currently we don't experience any difference in GitLab behavior, but the sidekiq log contains the following error:
2018-02-08_13:03:34.05548 2018-02-08T13:03:34.055Z 412 TID-otvj46b2o WARN: {"context":"Job raised exception","job":{"class":"BackgroundMigrationWorker","args":["PrepareUntrackedUploads",[]] ,"retry":3,"queue":"background_migration","jid":"a5d190e336b89f5d48ea4588","created_at":1518094743.6086571,"enqueued_at":1518095014.0440173},"jobstr":"{\"class\":\"BackgroundMigrationWorker\",\"args\":[\"PrepareUntrackedUploads\",[]] ,\"retry\":3,\"queue\":\"background_migration\",\"jid\":\"a5d190e336b89f5d48ea4588\",\"created_at\":1518094743.6086571,\"enqueued_at\":1518095014.0440173}"}
2018-02-08_13:03:34.05549 2018-02-08T13:03:34.055Z 412 TID-otvj46b2o WARN: ActiveRecord::StatementInvalid: PG::SyntaxError: ERROR: syntax error at or near "ON"
2018-02-08_13:03:34.05550 LINE 1: ...T INTO untracked_files_for_uploads (path) VALUES ON CONFLIC...
2018-02-08_13:03:34.05550 ^
2018-02-08_13:03:34.05551 : INSERT INTO untracked_files_for_uploads (path) VALUES ON CONFLICT DO NOTHING;
2018-02-08_13:03:34.05551 2018-02-08T13:03:34.055Z 412 TID-otvj46b2o WARN: /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/peek-pg-1.3.0/lib/peek/views/pg.rb:17:in `async_exec'
2018-02-08_13:03:34.05554 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/peek-pg-1.3.0/lib/peek/views/pg.rb:17:in `async_exec'
2018-02-08_13:03:34.05555 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
2018-02-08_13:03:34.05556 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
2018-02-08_13:03:34.05556 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.10/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2018-02-08_13:03:34.05557 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
2018-02-08_13:03:34.05558 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in `execute'
2018-02-08_13:03:34.05561 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/prepare_untracked_uploads.rb:121:in `insert_file_paths'
2018-02-08_13:03:34.05561 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/prepare_untracked_uploads.rb:121:in `insert_file_paths'
2018-02-08_13:03:34.05562 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/prepare_untracked_uploads.rb:65:in `block in store_untracked_file_paths'
2018-02-08_13:03:34.05566 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/prepare_untracked_uploads.rb:91:in `yield_paths_in_batches'
2018-02-08_13:03:34.05566 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/background_migration/prepare_untracked_uploads.rb:73:in `block in each_file_batch'
...
up-to-date GitLab: 10.4.3, using Docker gitlab/gitlab-ce:latest (id: sha256:feb7897eccfa5c752960d1e2061bd0bfcf78957f6aa16b1c19cb0b1958b8a311, digest: gitlab/gitlab-ce@sha256:ed6ce86e7847d14f0c75cacf7b5b4dfedeb3bb55b3be4c06c3d6124df8b20689),
using external, but containerized pgsql 9.6 via docker network.
Steps to reproduce
N/A
What is the current bug behavior?
background job fails.
What is the expected correct behavior?
background job should succeed.
Relevant logs and/or screenshots
see Summary.
Output of checks
Results of GitLab application Check
everything ok, or skipped.
Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Results of GitLab environment info
# docker exec -it gitlab gitlab-rake gitlab:env:info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.3.6p384
Gem Version: 2.6.13
Bundler Version:1.13.7
Rake Version: 12.3.0
Redis Version: 3.2.11
Git Version: 2.14.3
Sidekiq Version:5.0.5
Go Version: unknown
GitLab information
Version: 10.4.3
Revision: 183dd5d
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://xxx
HTTP Clone URL: https://xxx/some-group/some-project.git
SSH Clone URL: git@xxx:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
Possible fixes
N/A