I trying to write a script that queries a feature layer, crosswalks some attributes, dissolves the crosswalked features, then adds them to another layer. Everything seems to be working up to the dissolve call. I'm trying to feed a feature collection to arcgis.features.analysis.dissolve_boundaries(), but I keep getting an error that I can't fix.
The jobs fails and the error it produces is "Connection reset by peer: socket write error". What does that even mean? What could be causing this?
There more to the script, but here's the bit that makes the feature collection and tries to call dissolve_boundaries():
tfset = arcgis.features.FeatureSet(tfeatures)
tfcollection = arcgis.features.FeatureCollection.from_featureset(tfset)
result = arcgis.features.analysis.dissolve_boundaries(input_layer=tfcollection)
and here's the traceback:
Connection reset by peer: socket write error
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
/tmp/ipykernel_27/2488076861.py in <cell line: 249>()
354 tfcollection = arcgis.features.FeatureCollection.from_featureset(tfset)
355
--> 356 diss = arcgis.features.manage_data.dissolve_boundaries(tfcollection)
357
358 print('uploading features\n')
/opt/conda/lib/python3.9/site-packages/arcgis/features/manage_data.py in dissolve_boundaries(input_layer, dissolve_fields, summary_fields, output_name, context, gis, estimate, multi_part_features, future)
277 fn=gis._tools.featureanalysis._tbx.dissolve_boundaries, **kwargs
278 )
--> 279 return gis._tools.featureanalysis.dissolve_boundaries(**params)
280
281
/opt/conda/lib/python3.9/site-packages/arcgis/_impl/tools.py in dissolve_boundaries(self, input_layer, dissolve_fields, summary_fields, output_name, context, estimate, multi_part_features, future)
3308 if future:
3309 return gpjob
-> 3310 return gpjob.result()
3311
3312 # ----------------------------------------------------------------------
/opt/conda/lib/python3.9/site-packages/arcgis/geoprocessing/_job.py in result(self)
230 return None
231 if self._is_fa:
--> 232 return self._process_fa(self._future.result())
233 elif self._is_ra:
234 return self._process_ra(self._future.result())
/opt/conda/lib/python3.9/concurrent/futures/_base.py in result(self, timeout)
444 raise CancelledError()
445 elif self._state == FINISHED:
--> 446 return self.__get_result()
447 else:
448 raise TimeoutError()
/opt/conda/lib/python3.9/concurrent/futures/_base.py in __get_result(self)
389 if self._exception:
390 try:
--> 391 raise self._exception
392 finally:
393 # Break a reference cycle with the exception in self._exception
/opt/conda/lib/python3.9/concurrent/futures/thread.py in run(self)
56
57 try:
---> 58 result = self.fn(*self.args, **self.kwargs)
59 except BaseException as exc:
60 self.future.set_exception(exc)
/opt/conda/lib/python3.9/site-packages/arcgis/geoprocessing/_support.py in _future_op(gptool, task_url, job_info, job_id, param_db, return_values, return_messages)
326 return_messages,
327 ):
--> 328 job_info = _analysis_job_status(gptool, task_url, job_info)
329 resp = _analysis_job_results(gptool, task_url, job_info, job_id)
330
/opt/conda/lib/python3.9/site-packages/arcgis/geoprocessing/_support.py in _analysis_job_status(gptool, task_url, job_info)
244
245 if job_response.get("jobStatus") == "esriJobFailed":
--> 246 raise Exception("Job failed.")
247 elif job_response.get("jobStatus") == "esriJobCancelled":
248 raise Exception("Job cancelled.")
Exception: Job failed.
Solved! Go to Solution.
It looks like the dissolve call only accepts service layers, not feature collections? The docs are little confusing, but that is, apparently, the only thing that works.
It looks like the dissolve call only accepts service layers, not feature collections? The docs are little confusing, but that is, apparently, the only thing that works.