Add Write Permission to File to Allow truncate() Operation to Succeed #296
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I got the following error and am proposing this change to remediate.
Status code: 1
Error: Traceback (most recent call last):
File "/usr/src/app/preload.py", line 978, in
result = method(**data.get("parameters", {}))
File "/usr/src/app/preload.py", line 923, in main_preload
preload(additional_bytes, app_data, splash_image_path)
File "/usr/src/app/preload.py", line 713, in preload
part.resize(additional_bytes)
File "/usr/src/app/preload.py", line 434, in resize
self._resize_last_partition_of_disk_image(additional_bytes)
File "/usr/src/app/preload.py", line 334, in _resize_last_partition_of_disk_image
expand_file(self.image, additional_bytes)
File "/usr/src/app/preload.py", line 523, in expand_file
f.truncate(size + additional_bytes)
PermissionError: [Errno 13] Permission denied