Image upload crash the site

Technical Support
  • After trying to upload an image the site crash and restart here is the logs:

    2019-07-16T20:33:33.329Z [18909] - error:  message=/lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /pash/to/nodebb/node_modules/sharp/build/Release/../../vendor/lib/libpng16.so.16), stack=Error: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /path/to/nodebb/node_modules/sharp/build/Release/../../vendor/lib/libpng16.so.16)
        at Error (native)
        at Object.Module._extensions..node (module.js:604:18)
        at Module.load (module.js:494:32)
        at tryModuleLoad (module.js:453:12)
        at Function.Module._load (module.js:445:3)
        at Module.require (module.js:504:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/path/to/nodebb/node_modules/sharp/lib/constructor.js:10:15)
        at Module._compile (module.js:577:32)
        at Object.Module._extensions..js (module.js:586:10)
        at Module.load (module.js:494:32)
        at tryModuleLoad (module.js:453:12)
        at Function.Module._load (module.js:445:3)
        at Module.require (module.js:504:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/path/to/nodebb/node_modules/sharp/lib/index.js:3:15)
    2019-07-16T20:33:33.332Z [18909] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    2019-07-16T20:33:33.336Z [18909] - info: [app] Web server closed to connections.
    2019-07-16T20:33:33.342Z [18909] - info: [app] Database connection closed.
    2019-07-16T20:33:33.343Z [18909] - info: [app] Shutdown complete.
    [cluster] Child Process (18909) has exited (code: 1, signal: null)
    [cluster] Spinning up another process...
    2019-07-16T20:33:33.839Z [18994] - info: Initializing NodeBB v1.10.2 http://mysite.com:2468
    [benchpressjs] Unable to build or find a suitable native module, falling back to JS version
    2019-07-16T20:33:36.702Z [18994] - info: [socket.io] Restricting access to origin: http://mysite.com:*
    Tue, 16 Jul 2019 20:33:36 GMT hsts deprecated The "includeSubdomains" parameter is deprecated. Use "includeSubDomains" (with a capital D) instead. at node_modules/helmet/index.js:33:28
    Tue, 16 Jul 2019 20:33:36 GMT hsts deprecated The "setIf" parameter is deprecated. Refer to the documentation to see how to set the header conditionally. at node_modules/helmet/index.js:33:28
    2019-07-16T20:33:37.176Z [18994] - info: Routes added
    2019-07-16T20:33:37.184Z [18994] - info: NodeBB Ready
    2019-07-16T20:33:37.193Z [18994] - info: Enabling 'trust proxy'
    2019-07-16T20:33:37.200Z [18994] - info: NodeBB is now listening on: 0.0.0.0:2468
    
  • Solved, thank you


Suggested Topics


  • 0 Votes
    7 Posts
    456 Views

    Okay so just to confirm this is caused by an error in sharp, try creating a file called test-sharp.js in your nodebb directory with the following contents:

    'use strict'; const fs = require('fs/promises'); const sharp = require('sharp'); async function run() { const input = await fs.readFile('public/logo.png'); await sharp(input) .resize({ width: 100 }) .toFile('build/public/logo.png'); } run().then(() => {}, err => setTimeout(() => { throw err; }, 0));

    Then run it like node test-sharp.js. It should create the file build/public/logo.png. Check the exit code with echo $?.

  • 0 Votes
    4 Posts
    328 Views

    thanks for both suggestions I will give them a try

  • 0 Votes
    3 Posts
    282 Views

    @PitaJ said in No Upload Picture Option On Android Chrome browser:

    o scroll the tool icons to the left, revealing more? I attached the following screenshot from my Android phone.

    haha! you are right!... Thank you! I do not use Android myself... and the person that used did not see that... and I had a quick look and couldn't find it either... good stuff! thanks again!

    Andre

  • Remove category image

    Technical Support
    0 Votes
    2 Posts
    815 Views

    Never mind.. when i went back into change something in the category the remove image button showed up 🙂

  • 0 Votes
    5 Posts
    1k Views

    @a_5mith said:

    hljs

    Im using the default nodebb composer.

    I think I've fixed the problem, temporarily. I manage to remove those long text (http://pastebin.com/wQktbjtT) and it fixed the problem.

    The long text string seems to break nodebb. I test posting the same string again, but nodebb wont allow as it is longer than 32767 character.

    Thanks for your time @a_5mith