gee_asset_manager
gee_asset_manager copied to clipboard
ee.ee_exception.EEException: Invalid JSON payload received. Unknown name "value" at 'image_manifest.missing_data': Cannot find field.
receiving this error with or without using --nodata parameter or -m metadata values
no images gets uploaded
Traceback (most recent call last):
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/ee/data.py", line 324, in _execute_cloud_call
return call.execute(num_retries=num_retries)
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/googleapiclient/http.py", line 856, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/image:import?alt=json returned "Invalid JSON payload received. Unknown name "value" at 'image_manifest.
missing_data': Cannot find field.". Details: "[{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'image_manifest.missing_data', 'description': 'Invalid JSON payload received. Unknown name "value" at \'ima
ge_manifest.missing_data\': Cannot find field.'}]}]">
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jack/gee_asset_manager/gee_asset_manager/batch_uploader.py", line 126, in upload
task_id = __start_ingestion_task(asset_request)
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 212, in call
raise attempt.get()
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/six.py", line 696, in reraise
raise value
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "/home/jack/gee_asset_manager/gee_asset_manager/batch_uploader.py", line 195, in __start_ingestion_task
_ = ee.data.startIngestion(task_id, asset_request)
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/ee/data.py", line 1393, in startIngestion
operation = _execute_cloud_call(
File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/ee/data.py", line 326, in _execute_cloud_call
raise _translate_cloud_exception(e)
ee.ee_exception.EEException: Invalid JSON payload received. Unknown name "value" at 'image_manifest.missing_data': Cannot find field.
This fixes it in batch_uploader.py: "missing_data": {"values": [nodata_value] }
There's a change in the manifest https://developers.google.com/earth-engine/image_manifest
def __create_asset_request(asset_full_path, gsid, properties, nodata_value, band_names):
if band_names:
band_names = [{'id': name} for name in band_names]
return {"id": asset_full_path,
"tilesets": [
{"sources": [
{"primaryPath": gsid,
"additionalPaths": []
}
]}
],
"bands": band_names,
"properties": properties,
"missing_data": {"values": [nodata_value] },
}