[opensuse-buildservice] Random crashes when calling 'cmd=enablechannel'
Hello List, I've been trying to debug a random issue that is causing a lot of headache and is blocking my automated scripts. My script [1] calls http://$apiserver/source/$projid/$channelpkg.Channels?cmd=enablechannel&user=srinidhi to enable channels for a maintenance incident. Randomly, this call causes a crash on the API server. From the log: ... I, [2019-08-01T11:48:34.341942 #2256] INFO -- : [9a6b135f-b704-413a-9248-474bd491666f] [2256:42507.47] Completed 500 Internal Server Error in 311ms (ActiveRecord: 29.5ms | Backend: 55.8ms | XML: 0.0ms) F, [2019-08-01T11:48:34.349701 #2256] FATAL -- : [9a6b135f-b704-413a-9248-474bd491666f] [2256:42507.48] F, [2019-08-01T11:48:34.349830 #2256] FATAL -- : [9a6b135f-b704-413a-9248-474bd491666f] [2256:42507.48] ActiveRecord::RecordNotUnique (Mysql2::Error: Duplicate entry '123825' for key 'PRIMARY': INSERT INTO `backend_packages` (`package_id` , `links_to_id`, `updated_at`, `srcmd5`, `verifymd5`, `expandedmd5`) VALUES (123825, 76755, '2019-08-01 06:18:34.304379', 'ef89a8d97ca49edfac0245af176194b6', '6abbb394c22c13541a9c040508202525', 'c8be756ddf5c8a13019debf3b9140235')): F, [2019-08-01T11:48:34.349875 #2256] FATAL -- : [9a6b135f-b704-413a-9248-474bd491666f] [2256:42507.48] F, [2019-08-01T11:48:34.349909 #2256] FATAL -- : [9a6b135f-b704-413a-9248-474bd491666f] [2256:42507.48] app/models/package.rb:791:in `store' [9a6b135f-b704-413a-9248-474bd491666f] app/models/package.rb:1270:in `enable_for_repository' [9a6b135f-b704-413a-9248-474bd491666f] app/models/channel.rb:174:in `block in add_channel_repos_to_project' [9a6b135f-b704-413a-9248-474bd491666f] app/models/channel.rb:162:in `add_channel_repos_to_project' [9a6b135f-b704-413a-9248-474bd491666f] app/models/package.rb:1017:in `modify_channel' [9a6b135f-b704-413a-9248-474bd491666f] app/controllers/source_controller.rb:1199:in `package_command_enablechannel' [9a6b135f-b704-413a-9248-474bd491666f] app/controllers/application_controller.rb:371:in `dispatch_command' [9a6b135f-b704-413a-9248-474bd491666f] app/controllers/source_controller.rb:369:in `package_command' [9a6b135f-b704-413a-9248-474bd491666f] config/initializers/wrap_parameters.rb:38:in `call' ... If I run this command again (manually) it works! Could someone please tell me how do I find and cleanup these "Duplicate entries" from the database? Also, how do I avoid getting into this situation? Regards, Srinidhi. [1] https://lists.opensuse.org/opensuse-buildservice/2019-07/msg00024.html -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Hey, On 01.08.19 09:14, Srinidhi B wrote:
Could someone please tell me how do I find and cleanup these "Duplicate entries" from the database?
There are no duplicate entries in the database. It's precisely this that is avoiding duplicate entries. The question is, why is you API call trying to create duplicated entries. That we can solve in an issue on github, not here please. Henne -- Henne Vogelsang http://www.opensuse.org Everybody has a plan, until they get hit. - Mike Tyson -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (2)
-
Henne Vogelsang
-
Srinidhi B