Skip to main content
Solved

Creating schedule with V3 api /fmerest/v3/schedules always creates a unhandled exception

  • August 9, 2022
  • 2 replies
  • 49 views

When I use Python to try and post a schedule to FME Server using the v3 api, it always creates a Unhandled Exception on the server-side. I can view the exception in the Catalina log. I'm unsure why, but it thinks the payload isn't JSON even though it is. Has anyone been able to successfully post a schedule to the schedule endpoint using Python or other language and can post an example? I must be doing something wrong, but cannot tell.

 

The JSON is:

params = {"begin":"2022-08-08T01:00:00", "name":"test", "description":"test", "skipUntilJobComplete":True, "enabled": True, "interval":2, "recurrence":"interval", "repository":"TEST", "workspace":"test.fmw", "unit":"MINUTE", "category":"Utilities"}

 

which is posted like this in Python:

serviceresponse = requests.post(jobSubmitUrl,json=params,headers=jobHeader)

 

The error is: b'{"message":"An unhandled exception has occurred due to some unexpectedly omitted information, consult the web service logs for further details"}' In the Catalina log, I find it says that it can't parse the JSON.

 

The header works fine and is used elsewhere with no issue, so I'm certain that isn't the problem.

 

Any ideas would be appreciated.

Best answer by david.jones

That wasn't the issue, my code is in Python, and booleans are uppercase. The actual issue is there is a known defect in FME Server 2021 (Error: as FMESERVER-17589), the temporary fix is to include a empty request object in the payload.

 

This works:

params = {"request":{}, "begin":"2022-08-08T01:00:00", "name":"test", "description":"test", "skipUntilJobComplete":True, "enabled": True, "interval":2, "recurrence":"interval", "repository":"TEST", "workspace":"test.fmw", "unit":"MINUTE", "category":"Utilities"}

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 132 replies
  • August 9, 2022

https://jsonformatter.org/ is complaining about the True's, try changing them to lowercase true.


  • Author
  • 1 reply
  • Best Answer
  • August 9, 2022

That wasn't the issue, my code is in Python, and booleans are uppercase. The actual issue is there is a known defect in FME Server 2021 (Error: as FMESERVER-17589), the temporary fix is to include a empty request object in the payload.

 

This works:

params = {"request":{}, "begin":"2022-08-08T01:00:00", "name":"test", "description":"test", "skipUntilJobComplete":True, "enabled": True, "interval":2, "recurrence":"interval", "repository":"TEST", "workspace":"test.fmw", "unit":"MINUTE", "category":"Utilities"}