Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Issue

The URI Too Long error occurs when a user tries to sync and runs into a Salesforce platform restriction.

Solution

This is a rare error that occurs when something goes wrong with the user's hard drive. Pulsar uses an encrypted SQLite database to store the user's data on the device and when the hard disk malfunctions, the application cannot access the database and prints the URI Too Long error. 
Here is a blog post that we think is helpful to understand what could cause this problem: SQLite Database Disk Image Is Malformed.

Another reason for the error is the failure in disk drive/ flash memory. It can affect the content of the file and result in corruption. Moreover, in such a situation, it becomes tough to resolve this issue.

Example

[20-05-18 18:47:28][WARN ][539128692048] - Unexpected HTTP response code: 414

[20-05-18 18:47:28][ERROR][539128692048] - Error response: <h1>Bad Message 414</h1><pre>reason: URI Too Long</pre>

[20-05-18 18:47:28][INFO ][539128692048] - QueryWave received: Account wave 0

[20-05-18 18:47:28][INFO ][539128692048] - **** Account -- waveMaxWaves 25 waveNumber 0 lastWave false

Solution

When a client application queries the Salesforce platform, it cannot do a simple wild character query like select * from Account. It has to specify all fields by API name. Pulsar has to send a query for all fields found in the schema for this particular user profile.

Our customers who have run into this problem often were testing with an admin user account where it has permission to view all fields on that object. If you switch to a test user account representative of a real user, you may not have this problem. If you continue to have a problem, you will want to limit how many fields are visible to the regular user.

It is hard to find the exact limit on the URI length from Salesforce documentation but you can reference this Stack Exchange post where the developer says the following: "Through trial and error, I was able to determine that Salesforce's limit on the URI length is 16,088 characters."

https://salesforce.stackexchange.com/questions/195449/what-is-the-longest-uri-that-salesforce-will-accept-through-the-rest-api