Metadatamanagement: "Whitelabel Error Page" for attachments

Created on 27 Mar 2019  路  7Comments  路  Source: dzhw/metadatamanagement

Noticed during the update of metadata for gra2005 (Version 2.0.0; no re-release yet):
When I upload attachments, they are available first. After a certain time, the following error message appears:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Mar 27 07:09:30 UTC 2019
There was an unexpected error (type=Internal Server Error, status=500).
No contentType data for this GridFS file

Examples:


For the domain object "instruments", the problem only occurs with instrument 3. For instrument 1 and 2, most documents from version 1.0.0 were retained, but partially renewed. Everything works there.

Examples:


For the domain objekt "study" it works as well


In the released version 1.0.0 the problem does not seem to exist, e.g.
https://metadata.fdz.dzhw.eu/public/files/data-sets/dat-gra2005-ds1$-1.0.0/attachments/dsreport-gra2005-ds1.pdf

(@rbirkelbach )

crosscutting hotfix bug

All 7 comments

Seems that the computation of the content type is broken. For the first linked example it is explicitly null:

{
    "_id" : ObjectId("5c9a330d03d9ce0017e21ea2"),
    "metadata" : {
        "_id" : "/public/files/data-sets/dat-gra2005-ds1$/attachments/dsreport-gra2005-ds1.pdf",
        "dataSetId" : "dat-gra2005-ds1$",
        "dataAcquisitionProjectId" : "gra2005",
        "description" : {
            "de" : "Codebook des ersten Datensatzes des DZHW-Absolventenpanels 2005",
            "en" : "Codebook of the first dataset of the DZHW Graduate Panel 2005"
        },
        "title" : "Variablendokumentation: DZHW-Absolventenpanel 2005 (Datensatz 1)",
        "language" : "de",
        "fileName" : "dsreport-gra2005-ds1.pdf",
        "dataSetNumber" : 1,
        "indexInDataSet" : 1,
        "masterId" : "/public/files/data-sets/dat-gra2005-ds1$/attachments/dsreport-gra2005-ds1.pdf",
        "shadow" : false,
        "version" : NumberLong(4),
        "createdDate" : ISODate("2019-03-26T14:11:25.692Z"),
        "createdBy" : "robertbirkelbach",
        "lastModifiedDate" : ISODate("2019-03-26T18:47:35.217Z"),
        "lastModifiedBy" : "anneweber"
    },
    "filename" : "/data-sets/dat-gra2005-ds1$/attachments/dsreport-gra2005-ds1.pdf",
    "aliases" : null,
    "chunkSize" : NumberLong(261120),
    "uploadDate" : ISODate("2019-03-26T14:11:25.877Z"),
    "length" : NumberLong(4365390),
    "contentType" : null,
    "md5" : "32cab404f8e79bbc5ec1081c6ef7c314"
}

dsreport-gra2005-ds1.pdf @es-flavia here's the file

The following query returns all attachments with content-type null:

db.getCollection('fs.files').find({contentType: { $type: 10 }})

This returns currently 13 attachments:

/* 1 */
{
    "_id" : ObjectId("5c9a330d03d9ce0017e21ea2"),
    "filename" : "/data-sets/dat-gra2005-ds1$/attachments/dsreport-gra2005-ds1.pdf"
}

/* 2 */
{
    "_id" : ObjectId("5c9a334d3334ed000e2f6a22"),
    "filename" : "/data-sets/dat-gra2005-ds2$/attachments/dsreport-gra2005-ds2.pdf"
}

/* 3 */
{
    "_id" : ObjectId("5c9a337f3334ed000e2f6a25"),
    "filename" : "/data-sets/dat-gra2005-ds3$/attachments/dsreport-gra2005-ds3.pdf"
}

/* 4 */
{
    "_id" : ObjectId("5c9a33a203d9ce0017e21eb5"),
    "filename" : "/data-sets/dat-gra2005-ds4$/attachments/dsreport-gra2005-ds4.pdf"
}

/* 5 */
{
    "_id" : ObjectId("5c9a33bdde6790000e31babd"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/gra2005_W3_Main_VariableQuestionnaire_de.pdf"
}

/* 6 */
{
    "_id" : ObjectId("5c9a3466de6790000e31d858"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/gra2005_W3_Main_Questionnaire_de.pdf"
}

/* 7 */
{
    "_id" : ObjectId("5c9a3471de6790000e31d86a"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/gra2005_W3_Main_QuestionFlow_de.pdf"
}

/* 8 */
{
    "_id" : ObjectId("5c9a348103d9ce0017e21eba"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/gra2005_W3_Documentation_Flag-Variable_ParentalLeave_de.pdf"
}

/* 9 */
{
    "_id" : ObjectId("5c9a349103d9ce0017e21ebe"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/gra2005_W2-3_Documentation_ComparisonFigure_de.pdf"
}

/* 10 */
{
    "_id" : ObjectId("5c9a349b3334ed000e2f78fb"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/cl-destatis-bundesland-1990.xlsx"
}

/* 11 */
{
    "_id" : ObjectId("5c9a34a43334ed000e2f78ff"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/cl-destatis-ausland-2016.pdf"
}

/* 12 */
{
    "_id" : ObjectId("5c9a34acde6790000e31d872"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/cl-eurostat-deplznuts-2010.xlsx"
}

/* 13 */
{
    "_id" : ObjectId("5c9a34b5de6790000e31d876"),
    "filename" : "/instruments/ins-gra2005-ins3$/attachments/cl-destatis-kldb-2010.xls"
}

The whitelabel error page is caused by a missing content type for the file as already noted.
This particular error happens only if the metadata of a file is modified and saved without providing a file as well.

We are working on a fix, but it will go live tomorrow.

In the meantime you can do this to work around the issue:

If you wish to modify an existing attachment鈥檚 metadata you can modify it but you must also select the corresponding file through the file chooser (doesn鈥檛 matter if it is identical to the existing version).

The upload of completely new files should be unaffected.

Important: This step must also be repeated for each of the corrupted files listed by Ren茅 in a comment above to restore the content type.

@es-flavia @rreitmann
Many thanks your quick help. I have now re-uploaded all attachments, where the whitelabel error page appeared, without changing anything in the rest of the metadata.

@anneweber Should be fixed on prod. Close this issue if fixed...

Perfect, thank you!!!!! @rreitmann @es-flavia :bouquet::bouquet::bouquet:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbirkelbach picture rbirkelbach  路  6Comments

UteH picture UteH  路  6Comments

AndyDaniel1 picture AndyDaniel1  路  4Comments

rbirkelbach picture rbirkelbach  路  9Comments

kpstephan picture kpstephan  路  9Comments