Fwd: Erro no Cirandas!

Rodrigo Souto rodrigo at colivre.coop.br
Wed Aug 21 15:08:20 BRT 2013


Apparently this job is failing because it's trying to break the
uniqueness combination between profile_id and action_tracker_id.

There is a validation that would avoid this kind of things in the
Notification class but this code here
(/home/noosfero/noosfero-ecosol/lib/notify_activity_to_profiles_job.rb:22)
is inserting things straight to the database instead of using
ActiveRecord (as it is doing on the same file but in other lines).
Perhaps this is some performance boost but I don't know if it really
pays off if we can't avoid this kind of crashes.

Braulio escreveu isso ai:
> Hello all,
> 
> DelayedJobs are constantly returning these errors. Anybody knows the cause
> or the fix?
> 
> regards,
> bráulio
> 
> ---------- Forwarded message ----------
> From: Daniel Tygel <dtygel at gmail.com>
> Date: Tue, Aug 20, 2013 at 10:06 PM
> Subject: Erro no Cirandas!
> To: Bráulio B O Bhavamitra <brauliobo at gmail.com>
> 
> 
> 
> 
> 
> -------- Mensagem original --------  Assunto: [CIRANDAS] DelayedJob:
> PGError: ERRO: duplicar valor da chave viola a restrição de unicidade
> "index_action_tracker_notifications_on_profile_id_and_action_tra": insert
> into action_tracker_notifications(profile_id, action_tracker_id) select
> f.friend_id, 26197 from friendships as f where person_id=17 and f.friend_id
> not in (select atn.profile_id from action_tracker_notifications as atn
> where atn.action_tracker_id = 26197)  Data: Tue, 20 Aug 2013 21:39:29
> -0300  De:
> no-reply at cirandas.net  Responder a: no-reply at cirandas.net  Para:
> cirandas.erro at eita.org.br
> 
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract_adapter.rb:227:in
> `log'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/activerecord-2.3.15/lib/active_record/connection_adapters/postgresql_adapter.rb:520:in
> `execute'
> /home/noosfero/noosfero-ecosol/lib/notify_activity_to_profiles_job.rb:22:in
> `perform'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/backend/base.rb:65:in
> `invoke_job'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:123:in
> `run'
> /home/noosfero/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/timeout.rb:67:in
> `timeout'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:123:in
> `run'
> /home/noosfero/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/benchmark.rb:308:in
> `realtime'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:122:in
> `run'
> /home/noosfero/noosfero-ecosol/vendor/plugins/monkey_patches/rescue_delayed_job_crashes/init.rb:44:in
> `reserve_and_run_one_job'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:107:in
> `work_off'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:106:in
> `times'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:106:in
> `work_off'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:81:in
> `start'
> /home/noosfero/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/benchmark.rb:308:in
> `realtime'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:80:in
> `start'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:77:in
> `loop'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/worker.rb:77:in
> `start'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/command.rb:99:in
> `run'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/command.rb:78:in
> `run_process'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/application.rb:215:in
> `call'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/application.rb:215:in
> `start_proc'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/daemonize.rb:192:in
> `call'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/daemonize.rb:192:in
> `call_as_daemon'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/application.rb:219:in
> `start_proc'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/application.rb:255:in
> `start'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/controller.rb:69:in
> `run'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons.rb:188:in
> `run_proc'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in
> `call'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in
> `catch_exceptions'
> /home/noosfero/.rvm/gems/ree-1.8.7-2012.02 at noosfero/gems/daemons-1.0.10/lib/daemons.rb:187:in
> `run_proc'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/command.rb:77:in
> `run_process'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/command.rb:71:in
> `daemonize'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/command.rb:69:in
> `times'
> /home/noosfero/noosfero-ecosol/vendor/plugins/delayed_job/lib/delayed/command.rb:69:in
> `daemonize'
> /script/delayed_job:35
> 
> 
> 
> 
> 
> 
> 
> -- 
> "Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
> ideologia. Morra por sua ideologia" P.R. Sarkar
> 
> EITA - Educação, Informação e Tecnologias para Autogestão
> http://cirandas.net/brauliobo
> http://eita.org.br

> _______________________________________________
> Noosfero-dev mailing list
> Noosfero-dev at listas.softwarelivre.org
> http://listas.softwarelivre.org/cgi-bin/mailman/listinfo/noosfero-dev


-- 
Rodrigo Souto <rodrigo at colivre.coop.br> :: 55 71 8131-7714
Colivre - Cooperativa de Tecnologias Livres
http://www.colivre.coop.br/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20130821/23fc0422/attachment.pgp>


More information about the Noosfero-dev mailing list