Hello,
I published a toolbox that works in local server but i could not make it work as a geoprocessing tool.
My idea is that i want to be able to reach to workforce through using ArcGIS API and want to make operations over there by using the tool i created. It works without a problem on the ArcGIS Pro, but when i publish it as a geoprocessing device i get the following error.
Traceback (most recent call last): File "", line 71, in execute File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\apps\workforce\project.py", line 45, in __init__ self._assignment_schema = AssignmentSchema(self.assignments_layer) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_utils.py", line 158, in _lazy_property setattr(self, attr_name, fn(self)) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\apps\workforce\project.py", line 233, in assignments_layer return FeatureLayer(self.assignments_layer_url, self.gis) File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\apps\workforce\project.py", line 183, in assignments_layer_url return self._item_data['assignments']['url'] KeyError: 'assignments' Failed to execute (Tool). Failed to execute (Tool). Failed.
Hey,
I published it as a geoprocessing service. It worked as a tool however when i add the geoprocessing service to a webapp it gives me the error as
"C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\apps\workforce\project.py", line 183, in assignments_layer_url return self._item_data['assignments']['url'] KeyError: 'assignments' Failed to execute (Tool). Failed to execute (Tool). Failed."
I have an enterprise license where i publish the tool but it does not have workforce license in it . I try run the geoprocessing server on the web app on another license which has workforce license. Could that be the reason?
I don't think the licensing is an issue, but you could try testing it with another license with workforce.
Another thing to pay attention to is when the geoprocessing tool works... where are you running it from? It could have to do with permissions in the web app using a browser?
I use Chrome as my main browser. I tried running it on Mozilla still no luck so far.
I think i could not make my self clear enough. I run the toolbox from ArcGIS Pro and it works without a problem but if i publish it as a geoprocessing service it does not work. I tried it by using chrome and mozilla but they did not do the trick. I cannot access the assignment layer from online when i run the geoprocessing server.
But it is a workforce project I created in workforce apps. The assignment layer is already inside of the app. It gets created automatically.
OK... not sure how that works. It was just a suggestion to see if maybe the issue was from a permissions error with the assignment layer.