Processing hotlinked images error for constraint


(Dean Taylor) #1

I’m seeing the following error in the error logs after import:

PG::Error: ERROR: duplicate key value violates unique constraint "index_draft_sequences_on_user_id_and_draft_key"

Backtrace:

and this related exception:

exception: PG::Error: ERROR:  duplicate key value violates unique constraint "index_draft_sequences_on_user_id_and_draft_key"
DETAIL:  Key (user_id, draft_key)=(-1, topic_38679) already exists.
: INSERT INTO "draft_sequences" ("draft_key", "sequence", "user_id") VALUES ($1, $2, $3) RETURNING "id"
context: {"retry"=>true, "queue"=>"default", "class"=>"Sidekiq::Extensions::DelayedClass", "args"=>["---\n- !ruby/class 'Jobs::PullHotlinkedImages'\n- :delayed_perform\n- - :post_id: 311856\n    :bypass_bump: false\n    :current_site_id: default\n"], "jid"=>"a26e279dba6c645dc9c1fe32", "enqueued_at"=>1403402457.223576, "error_message"=>"PG::Error: ERROR:  duplicate key value violates unique constraint \"index_draft_sequences_on_user_id_and_draft_key\"\nDETAIL:  Key (user_id, draft_key)=(-1, topic_38679) already exists.\n: INSERT INTO \"draft_sequences\" (\"draft_key\", \"sequence\", \"user_id\") VALUES ($1, $2, $3) RETURNING \"id\"", "error_class"=>"ActiveRecord::RecordNotUnique", "failed_at"=>1403402760.840269, "retry_count"=>0}
backtrace: /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:827:in `get_last_result'

Backtrace:


(Sam Saffron) #2

Should be fixed as of:

https://github.com/discourse/discourse/commit/7e1bd88c3309d03fb77bf3519aa34ec95fdf42d6


(Sam Saffron) #3