Page 1 of 2
Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Tue Dec 17, 2019 12:45 am
by rob_marklands
Good day,
Has there been any recent changes in regards to when the error "This job is currently opened by USER. Please try again later." is displayed or how the job is counted as currently open? I didn't find any information in the blog posts, forum announcements or the API doc pages.
The issue is that since today we can't update job parts via the API anymore.
My users reported this new behaviour today and I confirmed it, where even after you click "Cancel" or "Save and Finish" on the job and even close simPro page in the browser, when our application is attempting to update the job catalogue as usual we still get this error. The only way for the call to succeed is for the user to log out from simPro.
URL of the POST request:
Code: Select all
https://{{client}}.simprosuite.com/api/v1.0/companies/0/jobs/{{job_id}}/sections/{{section_id}}/costCenters/{{cost_center_id}}/catalogs/multiple/
Response with the error:
Code: Select all
{
"errors": [
{
"path": null,
"message": "This job is currently opened by USER_NAME. Please try again later.",
"value": null
}
]
}
Yesterday this exact functionality was working fine and today something has changed. Creating new job attachments with "/jobs/{{job_id}}/attachments/files/", however, still works as before and the error is not received.
Please advise, thanks
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Tue Dec 17, 2019 4:54 am
by Muqeet
Hey Rob,
Simpro system locks any job from being modified when it is already opened by any other user. Before this new change, users were not getting errors but update was still not working for the users who have opened the job and making changes to it through API. This new change is mostly just an error message to notify the API users about the job status.
Closing the simpro pages dont do anything, however "Cancel" and "Save and Finish" should unlock the job for modification for other users.
Send me the build URL where you are getting this issue in a PM, we will look into it for you.
Thanks
Muqeet
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Tue Dec 17, 2019 11:10 pm
by rob_marklands
Hi Muqeet,
Thank you for the prompt response.
I understand that "Cancel" and "Save and Finish" should unlock the job, but even that does not appear to be working in the API use case.
PMed you the built URL.
Here are the steps to reproduce the issue:
1. Get user access token using Authorisation Code Grant. Let's call that user "A"
2. Application sends POST request to the API with user "A" access token to update catalog parts for a job that user "A" hasn't even opened in simPro yet
3. Get response with an error that the job is currently open by the same user "A". As a result parts are not updated.
4. If then another user "B" logs into simPro and opens that job, it will show message that the job is opened by that first user "A".
5. If user "A" opens simPro it will not show in the bottom ribbon that there this job is opened by them.
6. If user "A" then opens that job and clicks "Cancel", and then application attempts to send the request again, it will still say that the job is already open by user "A"
7. If user "A" logs out of the simPro, then API will accept the request and update the parts
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Wed Dec 18, 2019 2:34 am
by Muqeet
Thanks Rob, for letting us know about the issue, we were able to reproduce it on our end. We are working on a fix and will release it soon. I ll update this post when the fix is out.
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Thu Dec 19, 2019 9:26 pm
by rob_marklands
The issue looks to be fixed.
Thanks for addressing it.
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Fri Jan 24, 2020 1:26 am
by rob_marklands
Hi Muqeet,
Looks like there was an update which now prevents updating the job catalogue if the job is open in simPro by someone at the same time. This time if the user closes the job, catalogue can be updated successfully, and that works well and as expected.
However, there is a problem if the user who has the job open is also the user whose access token (Authorisation Code Grant) is used to make a write API call. This ends up in a situation where the user is preventing themselves from updating the job.
Could you please consider allowing to modify the job via API call by the user if the job is open by the same user in simPro?
Or is there an API call to unlock the job on behalf of the user? I searched through documentation and code examples and couldn't find any info on that.
Thanks
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Tue Jan 28, 2020 1:17 am
by Muqeet
Hi Rob,
What you are saying about same person making changes should be allowed, make sense to an extent... However, it can still corrupt data if two different sources making changes to a same resource, and to eliminate this confusion we lock the job when its open on enterprise application.
There is no way to unlock a locked resource through API, and I believe there shouldn't be because suppose when one person loads a resource to modify it and other person unlocks it through API, what would you expect to happen to the first person who is making changes to the resource, all the changes he made will be gone by the time he submits the resource because the second person unlocked it and sneaked through his changes.
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Sun Jun 21, 2020 11:34 pm
by iconone
I'm wondering is there is a timer for how long a job is locked for after a user has done any of the following:
- clicked Cancel (on the job)
- clicked Save
- logged out
- closed browser
I have built an API integration where:
- client finds a job number
- enters that number in their external scheduling system
- closes job in simPRO
- saves schedule, which fires off a Webhook, which does the API integration
At the start, the client had no issues with the integration.
Recently, there's been more
"This job is currently opened by USER. Please try again later" issues popping up.
The client claims to have the job closed, so I'm wondering if there's some sort of timer that I need to consider in the integration?
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Mon Jun 22, 2020 3:07 am
by Muqeet
Hello,
Once a job is closed, its unlocked and available for other users and API to make changes into it. There is no timer.
Re: Started getting error: "This job is currently opened by USER. Please try again later"
Posted: Mon Jun 22, 2020 4:44 am
by iconone
Hi Muqueet,
Are there any other possibilities to why this issue could exist?
The client is adamant that they have closed the job. Is there a "open / close job" log that's accessible?
I just need to find possible ways to investigate.
Thanks.