I'm using Windows 10, PostgreSQL 11.4, PostGIS 2.5.3 and Python 3 using virtual env from conda.
My data only have 1 band (grayscale)
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/raster/rasterlayer/add/
Django Version: 2.2.6
Python Version: 3.7.3
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.gis',
'raster',
'ras.apps.RasConfig']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\raster\tasks.py" in create_tiles
40. parser.reproject_rasterfile()
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\raster\tiles\parser.py" in reproject_rasterfile
206. dest_zip = zipfile.ZipFile(dest.name, 'w', allowZip64=True)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\zipfile.py" in init
1204. self.fp = io.open(file, filemode)
During handling of the above exception ([Errno 13] Permission denied: 'C:\Users\DELL\AppData\Local\Temp\tmpaadzqk14\tmpmp_6awy2.zip'), another exception occurred:
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\core\handlers\exception.py" in inner
34. response = get_response(request)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\core\handlers\base.py" in _get_response
115. response = self.process_exception_by_middleware(e, request)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\core\handlers\base.py" in _get_response
113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\contrib\admin\options.py" in wrapper
606. return self.admin_site.admin_view(view)(*args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\utils\decorators.py" in _wrapped_view
142. response = view_func(request, *args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\views\decorators\cache.py" in _wrapped_view_func
44. response = view_func(request, *args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\contrib\admin\sites.py" in inner
223. return view(request, *args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\contrib\admin\options.py" in add_view
1634. return self.changeform_view(request, None, form_url, extra_context)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\utils\decorators.py" in _wrapper
45. return bound_method(*args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\utils\decorators.py" in _wrapped_view
142. response = view_func(request, *args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\contrib\admin\options.py" in changeform_view
1522. return self._changeform_view(request, object_id, form_url, extra_context)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\contrib\admin\options.py" in _changeform_view
1561. self.save_model(request, new_object, form, not add)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\contrib\admin\options.py" in save_model
1088. obj.save()
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\db\models\base.py" in save
741. force_update=force_update, update_fields=update_fields)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\db\models\base.py" in save_base
790. update_fields=update_fields, raw=raw, using=using,
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\dispatch\dispatcher.py" in send
175. for receiver in self._live_receivers(sender)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\django\dispatch\dispatcher.py" in
175. for receiver in self._live_receivers(sender)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\raster\models.py" in parse_raster_layer_if_status_is_unparsed
243. parse(instance.id)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\raster\tasks.py" in parse
131. all_in_one(rasterlayer_id, zoom_range)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\celery\local.py" in call
191. return self._get_current_object()(*a, **kw)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\celery\app\task.py" in call
392. return self.run(*args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\raster\tasks.py" in all_in_one
77. create_tiles(rasterlayer_id, zoom_range, True)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\celery\local.py" in call
191. return self._get_current_object()(*a, **kw)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\celery\app\task.py" in call
392. return self.run(*args, **kwargs)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\site-packages\raster\tasks.py" in create_tiles
50. shutil.rmtree(parser.tmpdir)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\shutil.py" in rmtree
513. return _rmtree_unsafe(path, onerror)
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\shutil.py" in _rmtree_unsafe
397. onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\DELL\Anaconda3\envs\earth-analytics-python\lib\shutil.py" in _rmtree_unsafe
395. os.unlink(fullname)
Exception Type: PermissionError at /admin/raster/rasterlayer/add/
Exception Value: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\DELL\AppData\Local\Temp\tmpaadzqk14\test.tif_copy.GTiff'