Issues related to Box Upload

Certified Associate Developer

Hello All,

 

I have created an application to upload file to box and accordingly create a shared link for each of the files being uploaded, To achieve this functionality in a more efficient way I create 10 app accounts and I'm using multithreading logic to use all these apps with respect to their current usage. Only issue i'm getting here is related to multiple request at a same time. If the number of requests are very less than the application works perfectly fine but when we are doing a load test with 500 requests at a time I'm getting below error

 

Current date\/time MUST be before the expiration date\/time listed in the 'exp' claim

I had discussion with box team but according to them its happening due to time synchronization gap between appian server and box server, I know this is not true because if such is the case then it should be happening even when the number of requests are very less. If anyone have work on this feature and have any thoughts or suggestions related to this then kindly help me to resolve this error. Thanks in advance

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Dmitry S

    Hey Dmitry,

    Below is the error that I'm getting

    Result: [statusLine=HTTP/1.1 400 Bad Request, statusCode=400, headers=[Date:Wed, 18 Jul 2018 21:57:10 GMT,Content-Type:application/json,Connection:keep-alive,Cache-Control:no-store,Strict-Transport-Security:max-age=31536000,Vary:Accept-Encoding,Set-Cookie:site_preference=desktop; path=/; domain=.box.com; secure,Age:0], contentType=application/json, body={"error":"invalid_grant","error_description":"Current date\/time MUST be before the expiration date\/time listed in the 'exp' claim"}]

    Error: [title=The external system did not understand the request, message=The request was missing required details or was improperly formatted, detail=HTTP/1.1 400 Bad Request]

    -> The Web Api is calling a process model using a!processStart and passing the folder name as a parameter.  Attached is the screenshot of a process model that is being called by the web api

    ->One more thing I noticed related to process model execution. As you can see inside the process model I'm writing some values to mysql table. those values are nothing but the start and end time of document attached. Inside the "Process Attachment" subprocess the actual document upload is happening where I have a logic to end the process model incase there is any issue with the api call but the time difference which I'm getting inside the mysql table is around 15 mins which means the process model is waiting in a queue when the number of instances are high and that seems to be the reason behind token time out error.

    -> I also visited the link that you provided me but according to them we need to adjust time on server. If there is any mis-match happening between the appian server time and the box server time than why it is working fine when the number of requests are very less?

  • I guess the problem is here:
    > time difference which I'm getting inside the mysql table is around 15 mins which means the process model is waiting in a queue when the number of instances are high and that seems to be the reason behind token time out error.

    Can the call be redesigned to be more efficient, i.e.
    1- all the logic can be placed directly to Web API code to be synchronous like a!writeToDataStoreEntity() and onSuccess on this you call a!startProcess, etc.
    2- use batch mechanism for documents call and processing, i.e. while calling WebAPI you provide some parameters for number of documents or so and process them in a batch afterwards.

    Let me know if that helped. Could you also provide the screenshot of Process Attachment process model?