Wednesday 16 October 2019

Troubleshooting Box.com programmatic access

This post is loosely connected to:
Using Box.com Programatically (JWT)
Using Box.com Programatically (Part2)

Troubleshooting:
Box has a brilliant Connectivity Test Tool

ErrorSystem Error: System.AggregateException
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) as System.Threading.Tasks.Task'1.GetResultCore(Boolean waitCompletionNotification)
Initial Hypothesis:  As my Box programmatic access was working on 1 machine but not on a VM at my client i suspected it was a difference in the environment or network connectivity.
Resolution:  I added System.Threading dlls, it did not fix the issue as i assumed it was GAC on my machine but on on the server.  No effect.
Resolution:  Check traffic using Fiddler and could see URL were not reachable/returning data.  Use the Box.com Connectivity Test tool and I could see multiple outbound https/443 URL were being blocked by the corporate firewalls.

Error:  Error Message: System.AggregateException
 Stact Trace:    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
Initial HypothesisThis happened after the networking was corrected and from a machine on the Internet, so the issue is not networking.  I was not pushing the config.json file out to my bin directory, so the upload of a file was using an expired JWT.
Resolution:  The message did not give me a good inclining into the issue.  My output directory e.g. /bin folder was not getting updated with the config.json file.  I copied the correct JWT/config.json file and the error is resolved.

ErrorError Message : System.IO.IOException : based64 data appears to be truncated
Resolution:  Check the config.json file, my file got corrupted.

Error: Error Message : invalid_client
The client credentials are invalid.
Resolution:  The config.json was to a trial tenant that I previously has setup, get the correct config.json file.

Error: Error Message: invalid_grant
 Stact Trace: Signature verification error. The public key identified by "kid" must correspond to the private key used for signing.
Resolution: The Box admin team had revoked the JWT, a new config.json file was generated and fixed the issue.

0 comments:

Post a Comment