The exception you receive can be thrown only if BL works too long. Try the following:
Make the handler as easy as it can be: leave there only “echo “inside after handler\n”;”
Run ./CodeRunner.sh
Call POST method for this table from REST console
If it works fine ( object is created and you see phrase in coderunner logs ) - add one more row into handler: "echo “objectId: " . $blProjectObject->getObjectId() . “\n”;”
Stop coderunner with ./StopCodeRunner.sh and repeat steps 2 and 3
If it’s still OK ( you see objectId in logs ) - add the following row: "echo “ownerId: " . $blProjectObject->getOwnerId() . “\n”;”
Stop and start coderunner again
Login as any user through REST console and repeat step 3
Check coderunner logs
Please notify me about results, I hope that this way we shall find out what’s causing the problem.
best regards,
Alex
Open file “config.php” and check value for ‘‘location_classes’’. It should point correct folder with your code.
The best way to by-pass this problem is to generate new BL project from console and replace /classes folder in generated code with /classes folder with your old code.
There is no magic here, if the old code executes, you have a PHP interpreter that has old code cached somewhere. You could go for something drastic like scanning your harddrive to find where the old files are…
Ok, after rebooting my mac, running coderunner again (with secret key):
Try uploading blProjectObject: <ProProject.BLProjectObject: 0x7feb5b487030> with owner: Optional(“xxxx@xxxx.xxl”)
Fault! Error Creating BLProjectObject ‘test’: FAULT = ‘15000’ [Custom business logic execution has been terminated because it did not complete in permitted time - 20 seconds] <Custom business logic execution has been terminated because it did not complete in permitted time - 20 seconds>
and zero output in the coderunner debugger, just ‘waiting for events’
The object is created using the iOS API. The owner is set, see this debug output from my iOS app:
print (“Try uploading blProjectObject: (blProjectObject) with owner: (blProjectObject.owner?.email)”)
output:
Try uploading blProjectObject: <ProProject.BLProjectObject: 0x7f9055c86e50> with owner: Optional(“xxxx@xxxxx.xxx”)
Now getting the message:
Fault! Error Creating BLProjectObject ‘test’: FAULT = ‘15000’ [Custom business logic execution has been terminated because it did not complete in permitted time - 20 seconds] <Custom business logic execution has been terminated because it did not complete in permitted time - 20 seconds>
</Snip Snap>
syncIsRunning = true
// First convert the projectObject
let blProjectObject = blParser.convertProjectObject(projectObject)
print ("Try uploading blProjectObject: \(blProjectObject) with owner: \(blProjectObject.owner?.email)")
// Upload the object
let dataStore = BackendlessManager.sharedInstance.backendless.persistenceService.of(BLProjectObject().ofClass())
dataStore.save(blProjectObject, response: {(response:AnyObject!) -> Void in
print ("ProjectObject Upload OK: ",response.objectId)
// Update the backendID to the objectId of the Backendless Entity
self.updateBackendID(projectObject: projectObject, blProjectObject: response as! BLProjectObject)
// Save Core Data
self.cdHelper.save()
// Upload any customproperties that contain NSData
self.dataToUpload(projectObject)
}, error: {(fault:Fault!) -> Void in
print ("Fault! Error Creating BLProjectObject '\(projectObject.name)': ",fault)
if fault.faultCode == "1000" {
// ID Not found, remove it so object get created again
print ("stored backendID was not found in Backendless (objectId), remove it so the object get's recreated")
projectObject.backendID = nil
self.cdHelper.save()
}
self.uploadFailed()
})
}
The error you are getting indicates that the server-side code takes more than 20 seconds to run. The client-side code is pretty irrelevant for the error.
I posted the code because you asked where does the “Try uploading blProjectObject:” message come from? I thought it would be better to post the complete method so you can see what is going on.
Anyway: The server side code does as good as nothing, I just changed the log message a bit (see first post for the code) and commented out the group creation.
Now the weekend is gone and Im back at the office, I tried coderunner again: This time the timeout error is gone and it just works.
Is there any explanation for this behavior?
Im going to change the code a bit and rerun again to see what happens.
No, there were no modifications.
Anyway, we shall keep on trying to reproduce this issue. Notify us please if you have an idea or this issue reproduces again.
best regards,
Alex
Try uploading blProjectObject: <ProProject.BLProjectObject: 0x7fa7b2d13000> with owner: Optional(“xxxxx”)
Fault! Error Creating BLProjectObject ‘Afghaanse’: FAULT = ‘15000’ [Custom business logic execution has been terminated because it did not complete in permitted time - 20 seconds] <Custom business logic execution has been terminated because it did not complete in permitted time - 20 seconds>
I have no clue what the trigger is, but once I get this timeout, there is nothing I can do but wait for hours, or even days before all starts working again.
Ok, it look like when not using the ‘reset connection’ function in the debug page of the custom logic, but instead killing manually the process is causing this problem.
So it now looks like it is working ok if I run coderunner -> create object -> check test results in debugger -> press ‘reset connection’ -> modify server code -> re-run coderunner.
If for some reason this doesn’t solve my problem then I’ll report back,