inventaire / inventaire-client

webapp coupled to the inventaire server :books:
https://inventaire.io
48 stars 16 forks source link

Error when adding cover #452

Closed mrjoops closed 10 months ago

mrjoops commented 10 months ago

For a few days (less than a week), I get an error when adding a cover and the cover is not added.

I use Firefox and here is what the console displays:

[413][undefined] loggers.js:45:19
    i loggers.js:45
    update flash.svelte:22
    Re scheduler.js:115
    Me scheduler.js:79
    (Asynchrone : promise callback)
    qe scheduler.js:20
    ctx Component.js:81
    ctx Component.js:139
    Z app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    we lifecycle.js:105
    we lifecycle.js:104
    c edit_mode_buttons.svelte:14
    (Asynchrone : EventListener.handleEvent)
    z dom.js:361
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    it Component.js:44
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    it Component.js:44
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    p app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    p property_claims_editor.svelte:60
    Re scheduler.js:119
    Me scheduler.js:79
    (Asynchrone : promise callback)
    qe scheduler.js:20
    ctx Component.js:81
    ctx Component.js:139
    b app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    ie property_claims_editor.svelte:28
    (Asynchrone : EventListener.handleEvent)
    z dom.js:361
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    m app_modules_entities_components_editor_property_claims_editor_svelte.76613aad.js:1
    it Component.js:44
    m app_modules_entities_components_editor_labels_editor_svelte-app_modules_entities_components_e-d858f8.c9f0c51c.js:1
    m app_modules_entities_components_editor_labels_editor_svelte-app_modules_entities_components_e-d858f8.c9f0c51c.js:1
    m app_modules_entities_components_editor_labels_editor_svelte-app_modules_entities_components_e-d858f8.c9f0c51c.js:1
    it Component.js:44
    m app_modules_entities_components_editor_entity_edit_svelte-app_modules_general_components_drop-0deec3.520c45a4.js:1
    m app_modules_entities_components_editor_entity_edit_svelte-app_modules_general_components_drop-0deec3.520c45a4.js:1
    it Component.js:44
    at Component.js:162
    D app_modules_entities_components_editor_entity_edit_svelte-app_modules_general_components_drop-0deec3.520c45a4.js:1
    showChildComponent global_libs_extender.js:166
    j entities.js:318
    j entities.js:340
    (Asynchrone : promise callback)
    showEditEntityFromUri entities.js:81
    Underscore 3
    Backbone 3
    nn Underscore
    Backbone 2
    y app.js:113
maxlath commented 10 months ago

This 413 error code seems to caused by nginx when an image above 5MB was posted, could that have been your case? I guess we could increase the limit.

mrjoops commented 10 months ago

Well, no, the image is just above 3MB.

mrjoops commented 10 months ago

Here is the entity I try to update : https://inventaire.io/entity/isbn:9782356741080 And here is the image https://www.danielmaghen-editions.com/wp-content/uploads/2021/11/TER-INTE%CC%81GRALE-SITE.jpg (I tried to download it locally before and re-upload it, same error)

maxlath commented 10 months ago

Nice, I was able to reproduce the problem: it was indeed an issue with nginx client_max_body_size that was set to 5MB, combined with fact that the 3MB image was converted to 7MB base64 data. Increasing the value of client_max_body_size seems to have resolved the case above, but it would be nice to have a more helpful error message for images that are over the new threshold.