Erros in base-line docker re-implementation

Erros in base-line docker re-implementation  

  By: NiTo on Nov. 25, 2024, 8:21 a.m.

Hi Dear organizers, I am re-implementing the base line docker file. I have faced 4 errors that I could find solutions for 3 of them but the fourth error still persists. The log file below Shows the errors.

Error 1: docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./inference.sh": permission denied: unknown.

Solution: Added below code to line 51 of the Docker file

RUN chmod +x inference.sh

Error 2: Traceback (most recent call last): File "/opt/app/process.py", line 161, in main(params) File "/opt/app/process.py", line 62, in main post_process_main( File "/opt/app/src/post_process.py", line 82, in post_process_main with open(json_filename, "w") as fp: ^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: '/output/melanoma-3-class-nuclei-segmentation.json'

Solution

uncomment line 81 post_process.py

Error 3: Traceback (most recent call last): File "/opt/app/output_rename.py", line 83, in recover_filename(pred_folder, output_folder, rename_dict) File "/opt/app/output_rename.py", line 57, in recover_filename with tifffile.TiffWriter(new_file_path) as tif: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/tifffile/tifffile.py", line 1775, in init self.fh = FileHandle(file, mode=mode, size=0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/tifffile/tifffile.py", line 14727, in __init_ self.open() File "/home/user/.local/lib/python3.11/site-packages/tifffile/tifffile.py", line 14746, in open self._fh = open(self._file, self._mode, encoding=None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: '/output/images/melanoma-tissue-mask-segmentation/44795516-254e-4111-8ffc-fdc152f25f1a.tif'

Solution:

Added /opt/app to line 13 output_rename.py output_folder = '/opt/app/output/images/melanoma-tissue-mask-segmentation'

Error4 : =+= Expected output for tissue not found!

Checked using os.listdir and tissue file exists in the folder.

Solution: ??

 Last edited by: NiTo on Nov. 25, 2024, 8:23 a.m., edited 1 time in total.

Re: Erros in base-line docker re-implementation  

  By: danieleek on Nov. 25, 2024, 1:13 p.m.

Dear NiTo,

Thank you for your message. I noticed that you are writing your output to "/opt/app/output/...", however, the output should be written directly to "/output/...", please refer to the GC documentation. This is the reason why you are getting the error message "Expected output for tissue not found".

If you have further questions, feel free to reach out.

Kind regards,

Daniel

Re: Erros in base-line docker re-implementation  

  By: NiTo on Nov. 25, 2024, 2:30 p.m.

Dear Daniel, Thank you for your reply.

If I don't add the opt/app/ then I receive these errors:

PermissionError: [Errno 13] Permission denied: '/output/melanoma-3-class-nuclei-segmentation.json'

PermissionError: [Errno 13] Permission denied: '/output/images/melanoma-tissue-mask-segmentation/44795516-254e-4111-8ffc-fdc152f25f1a.tif'

The errors show that these directories do not exist.

 Last edited by: NiTo on Nov. 25, 2024, 2:32 p.m., edited 1 time in total.

Re: Erros in base-line docker re-implementation  

  By: danieleek on Nov. 25, 2024, 3:30 p.m.

Dear NiTo,

Please verify whether the /input and /output directories exist in your container. Make sure to add commands to create the directories inside your Dockerfile. Also, the "Permission denied" error does not necessarily mean that the directories do not exist; it can also mean you are trying to access the directory with insufficient permissions.

Kind regards,

Daniel

Re: Erros in base-line docker re-implementation  

  By: NiTo on Nov. 25, 2024, 5:28 p.m.

Dear Daniel,

Thank you for your reply.

You are correct that insufficient permissions can cause this error, but as I mentioned, when I change the directory, I have the necessary permissions. Therefore, I don't believe this error is related to user permissions.

I hope the other participants who are following this topic can report if they are experiencing similar issues. Perhaps I am overlooking something.

Re: Erros in base-line docker re-implementation  

  By: abhijeetpix on Nov. 27, 2024, 10:47 a.m.

We are also getting same error while saving files to /output.

Re: Erros in base-line docker re-implementation  

  By: chris.vanrun.diag on Nov. 28, 2024, 8:54 a.m.

Are you running into permissions when creating a submission on the platform or running your tests locally?

Re: Erros in base-line docker re-implementation  

  By: NiTo on Dec. 2, 2024, 10:16 a.m.

I encountered an error while running test_run.sh, which caused the results to not be saved in the correct folder upon submission. When I changed the folder name from /output to output1, the permission error was resolved, but the error still appears when using /output.

Could you please provide a video tutorial for the submission steps? It seems we might be missing something in the process.

Re: Erros in base-line docker re-implementation  

  By: NiTo on Dec. 2, 2024, 12:25 p.m.

As I mentioned, when I change the directory name the error disappears, it could indicate that the specific directory name we are using (/output) was causing issues due to permissions or other factors like conflicts with mounted directories or improper access rights.

Re: Erros in base-line docker re-implementation  

  By: chris.vanrun.diag on Dec. 3, 2024, 9:29 a.m.

When running your Docker image locally as a container, the output files get put in the test/output directory. However, in some use(r) cases, notably under newer Linux distributions, the permissions of these files are not set correctly because of special constructs on the filesystem.

A manual fix is to set the rights correctly, for instance using: sudo chmod -R o+rwx ./test/output.

Testing things locally is only a prelude to uploading the image after running the save script (save.sh).

You can find more information on submitting/testing here: https://grand-challenge.org/documentation/building-and-testing-the-container/

I also suggest replacing the .sh files in the example with the slightly newer ones found here: https://github.com/DIAGNijmegen/demo-challenge-pack/tree/main/test-phase/example-algorithm

The new do_test_run.sh should have some gimmicks that try to fix the permissions.

Good luck!

 Last edited by: chris.vanrun.diag on Dec. 3, 2024, 9:29 a.m., edited 1 time in total.
Reason: (Wanted to wish them good luck)