H2-invent / open-datenschutzcenter

Open Source Datenschutzmanagement System
https://open-datenschutzcenter.de
GNU Affero General Public License v3.0
34 stars 10 forks source link

500 server error on file download #242

Open Art4 opened 7 months ago

Art4 commented 7 months ago

Describe the bug

I can not download a file I've uploaded within a data processing.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Auftragsverarbeitung anlegen' https://app.open-datenschutzcenter.de/auftragsverarbeitung/new
  2. Go to 'Dokument zur Datenweitergabe hochladen' and upload a PDF
  3. Click save and go to the new entry.
  4. Click on "AVV herunterladen"
  5. A new tab opens, the file is not downloaded

Expected behavior The file should be downloaded or viewed.

Screenshots

grafik

Additional context

The click starts a request to https://app.open-datenschutzcenter.de/datenweitergabe/download/<id> (int Id redacted) and the server replies with a 500 Server error.

Art4 commented 7 months ago

I can reproduce this error on the demo page: https://demo.open-datenschutzcenter.de/datenweitergabe/download/94

Attempted to call an undefined method named "getMimetype" of class "League\Flysystem\Filesystem".

grafik

holema commented 7 months ago

Hello, this seems to be a weird problem. Is it working on other places in the ODC where documents can be uploaded? @holzi1005 DO you have any idea?

Art4 commented 7 months ago

In #142 the library league/flysystem was updated to v2. The API for getting the mime type with (docs v1)

$response = $filesystem->getMimetype($path);

was changed to (docs v2):

try {
    $mimeType = $filesystem->mimeType($path);
} catch (FilesystemException | UnableToRetrieveMetadata $exception) {
    // handle the error
}

In #163 there was made adjustments for v2, but these were not enough.

Art4 commented 7 months ago

I've created #245 to fix this issue.

holema commented 7 months ago

Hallo @Art4,

vielen dank für diene Mithilfe. Wir waren die letzte Woche nicht im Büro, weshalb deine PRs liegen geblieben sind. Wir werden und alle deine PRs diese Woche anschauen und dir dann eine Rückmeldung geben.