Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0057008
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersminoralways2024-11-06 10:512025-02-11 15:43
Reporterinaki_azkonobietaView Statuspublic 
Assigned ToAugustoMauch 
PriorityhighResolutionfixedFixed in VersionPR25Q2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionmainSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0057008: Wrong insert happening in some environments

DescriptionEvery 5 minutes we have the following error in the log:
2024-11-06 10:02:07,008 [DefaultQuartzScheduler_Worker-3] ERROR org.openbravo.scheduling.ProcessRunData - SQL error in query: INSERT INTO AD_Process_Run (AD_Org_ID, AD_Client_ID, Isactive, Created, Createdby, Updated, UpdatedBy, AD_Process_Run_ID, Status, Start_Time, Runtime, Log, AD_Process_Request_ID, Scheduler_Instance) VALUES (?, ?, 'Y', NOW(), ?, NOW(), ?, ?, ?, NOW(), ?, ?, ?, ?) :org.postgresql.util.PSQLException: ERROR: insert or update on table "ad_process_run" violates foreign key constraint "ad_process_run_ad_client"
  Detail: Key (ad_client_id)=(4028E6C72959682B01295A070852010D) is not present in table "ad_client".
2024-11-06 10:02:07,008 [DefaultQuartzScheduler_Worker-3] ERROR org.openbravo.scheduling.ProcessMonitor - @CODE=0@ERROR: insert or update on table "ad_process_run" violates foreign key constraint "ad_process_run_ad_client"
  Detail: Key (ad_client_id)=(4028E6C72959682B01295A070852010D) is not present in table "ad_client".
javax.servlet.ServletException: @CODE=0@ERROR: insert or update on table "ad_process_run" violates foreign key constraint "ad_process_run_ad_client"
  Detail: Key (ad_client_id)=(4028E6C72959682B01295A070852010D) is not present in table "ad_client".
    at org.openbravo.scheduling.ProcessRunData.insert(ProcessRunData.java:112) ~[classes/:?]
    at org.openbravo.scheduling.ProcessMonitor.jobToBeExecuted(ProcessMonitor.java:139) [classes/:?]
    at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1927) [quartz-2.3.2.jar:?]
    at org.quartz.core.JobRunShell.notifyListenersBeginning(JobRunShell.java:324) [quartz-2.3.2.jar:?]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:173) [quartz-2.3.2.jar:?]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.2.jar:?]
2024-11-06 10:02:07,008 [DefaultQuartzScheduler_Worker-3] ERROR org.openbravo.scheduling.DefaultJob - Error executing process org.openbravo.erpCommon.ad_process.AcctServerProcess
java.lang.NullPointerException: null
2024-11-06 10:02:07,008 [DefaultQuartzScheduler_Worker-3] INFO org.quartz.core.JobRunShell - Job OB_QUARTZ_GROUP.3CD8A7A68DFE4FDAAD20D2570D78DE3B threw a JobExecutionException:
org.quartz.JobExecutionException: java.lang.NullPointerException
    at org.openbravo.scheduling.DefaultJob.execute(DefaultJob.java:72) ~[classes/:?]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.2.jar:?]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.2.jar:?]
Caused by: java.lang.NullPointerException
2024-11-06 10:02:07,013 [DefaultQuartzScheduler_Worker-3] ERROR org.openbravo.dal.core.OBContext - The query 'select r from ADRole r where r.id=:roleId' returned 0 results while only 1 result was expected
2024-11-06 10:02:07,013 [DefaultQuartzScheduler_Worker-3] ERROR org.openbravo.scheduling.ProcessMonitor - null
java.lang.NullPointerException: null


SOlutions tried that didn't work:
 - Redeployed the instance for checking that there is not a problem of the context
- No records in the ad_process_request has this ad_client_id in his record
- No records in the ad_process_request have this ad_client_id in the context
select * from ad_process_request where ob_context like '%4028E6C72959682B01295A070852010D%';

The client is related to the QA Testing and the process launched is org.openbravo.erpCommon.ad_process.AcctServerProcess
Steps To ReproduceAutomatically after deleting the client
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0057981 newAugustoMauch Avoid logs of wrong insert happening in some environments 

-  Notes
(0171732)
AugustoMauch (administrator)
2024-11-10 22:55

IƱaki, can you elaborate the steps to reproduce, please?
(0172721)
alostale (manager)
2024-11-28 13:59

Lowering severity to minor as it doesn't have other known impact than error messages in logs.
(0175088)
javietxe (developer)
2025-02-04 10:03

The only steps to reproduce that we have is:

Do an install sources
Create a new client
Delete clients installed in the sampledata


By now it's happening at least in 4 clients
(0175243)
hgbot (developer)
2025-02-06 23:20

Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/merge_requests/1525 [^]
(0175484)
hgbot (developer)
2025-02-11 15:43

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo [^]
Changeset: c93cc699d16fda9d9a4e4e07fd1bd0d39fbb7850
Author: Augusto Mauch <a.mauch@orisha.com>
Date: 11-02-2025 14:43:04
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/commit/c93cc699d16fda9d9a4e4e07fd1bd0d39fbb7850 [^]

Fixes ISSUE-57008: Wrong insert happening in some environments

The problem was that when a client was deleted, the process scheduled for that client were not unscheduled and deleted. As a
consequence, when it was time to run those scheduled jobs, an entry would be created in AD_PROCESS_RUN, resulting in an error
because the client entry would no longer exist

---
M src/org/openbravo/service/system/SystemService.java
---
(0175485)
hgbot (developer)
2025-02-11 15:43

Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/merge_requests/1525 [^]

- Issue History
Date Modified Username Field Change
2024-11-06 10:51 inaki_azkonobieta New Issue
2024-11-06 10:51 inaki_azkonobieta Assigned To => Triage Omni OMS
2024-11-06 10:51 inaki_azkonobieta Modules => Core
2024-11-06 10:51 inaki_azkonobieta Triggers an Emergency Pack => No
2024-11-06 10:51 inaki_azkonobieta Assigned To Triage Omni OMS => Triage Platform Base
2024-11-06 10:52 javietxe Issue Monitored: javietxe
2024-11-10 22:55 AugustoMauch Note Added: 0171732
2024-11-10 22:55 AugustoMauch Status new => feedback
2024-11-28 13:59 alostale Note Added: 0172721
2024-11-28 13:59 alostale Severity major => minor
2025-02-04 10:03 javietxe Note Added: 0175088
2025-02-04 10:04 javietxe Status feedback => new
2025-02-04 10:40 javietxe Relationship added has duplicate 0057611
2025-02-04 10:41 javietxe Relationship deleted has duplicate 0057611
2025-02-06 23:16 AugustoMauch Assigned To Triage Platform Base => AugustoMauch
2025-02-06 23:16 AugustoMauch Status new => scheduled
2025-02-06 23:20 hgbot Note Added: 0175243
2025-02-11 15:43 hgbot Resolution open => fixed
2025-02-11 15:43 hgbot Status scheduled => closed
2025-02-11 15:43 hgbot Fixed in Version => PR25Q2
2025-02-11 15:43 hgbot Note Added: 0175484
2025-02-11 15:43 hgbot Note Added: 0175485
2025-02-13 13:06 javietxe Relationship added related to 0057981


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker