-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in spatial.to_featurelayer: Temp zip file being used by another process #2054
Comments
The underlying issue here may be that to_featurelayer is not cleaning up after itself as expected. It is leaving its temporary geodatabase behind on the local file system in a locked state. The expectation is that if one uses to_featurelayer, and then deletes the published feature layer (and related geodatabase) from ArcGIS Online, then one should be able to run to_featurelayer with the same parameters again. If one tries, then you get an error message:
If the second attempt to publish occurs in the same script/notebook session, then the presence of the lock files in the geodatabase prevent one from manually deleting the temporary geodatabase as a workaround to continue. The code below is another way to reproduce this issue. It was run in the standalone Jupyter notebook environment that comes with ArcGIS Pro 3.3.2, and includes version 2.3.0 of the ArcGIS Python API.
The resulting output in the notebook:
|
Describe the bug
When using spatial.to_featurelayer on a moderately large (62,000 rows, 93 columns) spatially enabled data frame, I'm getting the following error, and the feature layer is never created.
To Reproduce
Run the python script atteched below (file extension changed to .txt to allow uploading). I'd rather not post the data file here publicly, so if someone from ESRI takes a look at this, feel free to contact me and I'll email it. I've tried making a dummy file to post here instead of the actual one, but nothing I've generated so far has been able to cause this error. Also note that the file originally had 220k+ lines; I'm able to reduce the error with a subset of this file that's 62k lines or more, but once I start making files smaller than that, the error doesn't occur. This is independent of which portion of the records I use to create the smaller files.
to_featurelayer_bug_demo.txt
Expected behavior
I expect to_featurelayer() to create my feature layer without throwing an error.
Platform (please complete the following information):
Additional context
This error started occurring after Python API version 2.0.1. (Until I recently upgraded to ArcGIS Pro 3.3.1, I was specifically installing Python API version 2.0.1 instead of more recent versions because it would successfully run my script without throwing this error.)
The text was updated successfully, but these errors were encountered: