Skip to content
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

convert-ome returns 0 upon failure #1451

Closed
4 tasks done
johnyaku opened this issue Jan 22, 2024 · 1 comment · Fixed by #1455
Closed
4 tasks done

convert-ome returns 0 upon failure #1451

johnyaku opened this issue Jan 22, 2024 · 1 comment · Fixed by #1455
Labels

Comments

@johnyaku
Copy link

IMPORTANT!

This section is only for bug reports, which must follow the template below.

Please post any other questions to the official QuPath forum at https://forum.image.sc/tags/qupath

If in doubt, use image.sc. This helps us keep things organized.

Before we begin...

Before submitting your bug report, please check the following:

  • I've definitely found a bug (it you're not sure, please use image.sc instead)
  • I've checked https://qupath.github.io for a new release that might already have fixed the issue
  • I've checked the Changelog to see if the bug has already been fixed in the next release
  • I've checked for existing GitHub issues describing the same problem

Bug report

Describe the bug
QuPath convert-ome returns exit code 0 despite failure.

To Reproduce
Steps to reproduce the behavior:

scale=2
tile=1024
comp=ZLIB
input=broken_image.tif
output=broke_omage.ome.tif
QuPath convert-ome $input $output \
    --pyramid-scale=$scale \
    --tile-size=$tile \
    --compression=$comp \
    --parallelize

Output (truncated)

20:39:42.582 [main] [INFO ] q.l.i.s.b.BioFormatsServerOptions - Setting max Bio-Formats readers to 2
20:39:43.272 [main] [ERROR] loci.formats.tiff.TiffParser - Error reading IFD type at: 14
20:39:43.274 [main] [ERROR] loci.formats.tiff.TiffParser - Error reading IFD type at: 14
20:39:43.275 [main] [ERROR] loci.formats.tiff.TiffParser - Error reading IFD type at: 14
...
20:39:43.604 [main] [ERROR] q.l.i.writers.ome.ConvertCommand - Unable to open file:broken_image.tif
java.io.IOException: Unable to open file:broken_image.tif
        at qupath.lib.images.servers.ImageServers.buildServer(ImageServers.java:306)
        at qupath.lib.images.writers.ome.ConvertCommand.run(ConvertCommand.java:147)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at qupath.QuPath.main(QuPath.java:202)
        Suppressed: java.io.IOException: Unable to build ImageServer for file:/scratch/a56/jr9959/tmp/xenium-images/unassigned/230629_Xenium_ID4369_Primary_3962_LA-Spots/230629_Xenium_ID4369_Primary_3962_LA-Spot000001.tif with requested provider qupath.imagej.images.servers.ImageJServerBuilder
                at qupath.lib.images.servers.ImageServerBuilder$DefaultImageServerBuilder.buildOriginal(ImageServerBuilder.java:369)
                at qupath.lib.images.servers.ImageServerBuilder$AbstractServerBuilder.build(ImageServerBuilder.java:174)
                at qupath.lib.images.servers.ImageServers.buildServer(ImageServers.java:299)
                ... 10 common frames omitted

Checkout exit code:

echo $?
0

Expected behavior
Expected a non-zero return code

Desktop (HPC):

  • OS: Rocky Linux release 8.8 (Green Obsidian)
  • QuPath Version: 0.5.0
@johnyaku johnyaku added the bug label Jan 22, 2024
@petebankhead
Copy link
Member

Thanks, I think the solution might be simply to include System.exit(-1) in the catch clause here:

long duration = System.currentTimeMillis() - startTime;
logger.info(String.format("%s written in %.1f seconds", outputFile.getAbsolutePath(), duration/1000.0));
} catch (Exception e) {
logger.error(e.getLocalizedMessage(), e);
}

@Rylern could you check this please?

@Rylern Rylern linked a pull request Jan 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants