NoMethodError: undefined method `ci_id' for nil:NilClass
I just hit this locally by repeatedly forking a project, destroying it, and re-forking.
-Stan
22:53:19 rails-background-jobs.1 | 2016-04-07T05:53:19.760Z 22021 TID-oww2ptu1k WARN: {"class"=>"ProjectDestroyWorker", "args"=>[5, 1, {}], "retry"=>true, "queue"=>"default", "jid"=>"6ceced20198d1c3214043cb5", "created_at"=>1460008325.241152, "enqueued_at"=>1460008396.4966881, "error_message"=>"undefined method `ci_id' for nil:NilClass", "error_class"=>"NoMethodError", "failed_at"=>1460008399.757626, "retry_count"=>0}
22:53:19 rails-background-jobs.1 | 2016-04-07T05:53:19.760Z 22021 TID-oww2ptu1k WARN: NoMethodError: undefined method `ci_id' for nil:NilClass
22:53:19 rails-background-jobs.1 | 2016-04-07T05:53:19.760Z 22021 TID-oww2ptu1k WARN: /Users/stanhu/github/gitlab-development-kit/gitlab-ce/app/models/ci/build.rb:289:in `artifacts_path'
22:53:19 rails-background-jobs.1 | /Users/stanhu/github/gitlab-development-kit/gitlab-ce/app/uploaders/artifact_uploader.rb:24:in `store_dir'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:43:in `store_path'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/storage/file.rb:50:in `retrieve!'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:95:in `block in retrieve_from_store!'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/callbacks.rb:17:in `with_callbacks'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:94:in `retrieve_from_store!'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:323:in `uploader'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:392:in `remove!'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:195:in `remove_artifacts_metadata!'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/orm/activerecord.rb:49:in `remove_artifacts_metadata!'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:432:in `block in make_lambda'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:253:in `call'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:253:in `block in conditional'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:506:in `call'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:506:in `block in call'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:506:in `each'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:506:in `call'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:778:in `_run_commit_callbacks'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/transactions.rb:314:in `committed!'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/transaction.rb:89:in `commit_records'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/transaction.rb:153:in `commit'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/transaction.rb:175:in `commit_transaction'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `within_new_transaction'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
22:53:19 rails-background-jobs.1 | /Users/stanhu/.rbenv/versions/2.1.8/lib/ruby/gems/2.1.0/gems/activerecord-4.2.5.2/lib/active_record/transactions.rb:220:in `transaction'
22:53:19 rails-background-jobs.1 | /Users/stanhu/gitlab-development-kit/gitlab-ce/app/services/projects/destroy_service.rb:28:in `execute'
22:53:19 rails-background-jobs.1 | /Users/stanhu/gitlab-development-kit/gitlab-ce/app/workers/project_destroy_worker.rb:15:in `perform'
https://sentry.gitlap.com/gitlab/gitlabcom/issues/3761/
NoMethodError: undefined method `ci_id' for nil:NilClass
app/models/ci/build.rb:289:in `artifacts_path'
project.ci_id.to_s,
app/uploaders/artifact_uploader.rb:24:in `store_dir'
File.join(self.class.artifacts_path, @build.artifacts_path)
app/services/projects/destroy_service.rb:28:in `execute'
Project.transaction do
app/workers/project_destroy_worker.rb:15:in `perform'
::Projects::DestroyService.new(project, user, params).execute
lib/gitlab/sidekiq_middleware/memory_killer.rb:17:in `call'
yield
...
(52 additional frame(s) were not displayed)