Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

AddFeaturestoFeatureLayer() error message improvement? #158

Closed m-oneill closed 8 years ago

m-oneill commented 8 years ago

Not a bug; merely a friendly request wrapped in a question. Regarding AddFeaturesToFeatureLayer...

My service updates sometimes fail with an error message (shown below) that isn't completely helpful. The message is generic, and maybe it has to be that way, but I'm wondering if it can be made more helpful?

50/214 features added
error in function: AddFeaturesToFeatureLayer
error on line: line 394
error in file name: D:\code\testingArcRest351\Application\arcresthelper\featureservicetools.py
with error message: HTTPError: HTTP Error 500: Internal Server Error

So far I've seen this only when the data payload is sufficiently large in relation to the value of 'ChunkSize'. It took me a while and some head scratching to figure that out. I know what to do now when I see that message but perhaps future newbies could be spared from that trouble. The message, as it is now, lacks any clues as to the actual problem and its remedies.

Alternatively, perhaps this is better solved in documentation. I didn't know what the heck ChunkSize does or why I care until I ran into this problem and played around with its values by trial and error. Learning that ChunkSize would solve my error was in itself what some refer to as "a wild a$s guess". :8ball: LOL

When I see that issue, I do one or both of two corrective actions.

  1. process the data to make it smaller (fewer bytes)
  2. adjust the ChunkSize property down incrementally by trial and error.

Here's a sample JSON config file showing the ChunkSize property:

{
  "PublishingDetails": {
    "PublishData":"True",
    "ExistingServices": [
      {
        "URL": "your URL here",
        "ItemId": "bad1dc4e2xxxxxxxxx6f45656f3e",
        "LayerName": "your feature service layer name here",
        "DeleteInfo": {
          "Delete": true,
          "DeleteSQL": "1=1"
        },
        "FeatureClass": "..\\path\\to\\filegeo.gdb\\featureclassname",
        "ChunkSize":50
      }
    ]
  }
}
achapkowski commented 8 years ago

@m-oneill the response of a 500 error is a timeout error. I completely agree it's not too helpful, but that is what the AGO servers return.

I guess beyond samples, we need a solid wiki? What do you think?

MikeMillerGIS commented 8 years ago

I added a bunch of error check and better messaging. Still not going to fix the 500 error.