Uploaded image for project: 'Imaging'
  1. Imaging
  2. MGNLIMG-227

Corrupt imaging URLs causing 500 errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • 3.4.4
    • cache, image operations
    • None

      Steps to reproduce

      1.  open corrupt imaging URL:

      https://demoauthor.magnolia-cms.com/.imaging/mte/travel-demo-theme/1366/dam/tours/simon-mumenthaler-1...

      (Correct would be https://demoauthor.magnolia-cms.com/.imaging/mte/travel-demo-theme/1366/dam/tours/simon-mumenthaler-199501-unsplash/jcr:content/simon-mumenthaler-199501-unsplash.jpg

      Expected results

      404 response

      Actual results

      500 response with stacktrace

      Development notes

      The error is probably caused by wrapping the ImagingException into a RuntimeException:

      CachingImageStreamer.java:126

      // We're (ab)using CacheLoader -- this is NOT the cache. We're merely using it to schedule concurrent image generation jobs.
      .build(new CacheLoader<ImageGenerationJob<P>, Property>() {
      
          @Override
          public Property load(ImageGenerationJob<P> job) throws Exception {
              try {
                  return generateAndStore(job.getGenerator(), job.getParams());
              } catch (IOException | ImagingException e) {
                  // the LoadingCache will further wrap these in ExecutionExceptions, and we will, in turn, unwrap them ...
                  throw new RuntimeException(e);
              }
          }
      });
      

      It should probably be unpacked here again:
      CachingImageStreamer.java:149

      } catch (ExecutionException e) {
          // thrown if the LoadingCache's Function failed
          unwrapRuntimeException(e);
      }
      

      However, a breakpoint here does not hit.

        Acceptance criteria

              Unassigned Unassigned
              fschneider fabian schneider
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD