NodeBB can't upload image from my laptop but not from AWS server
Ken John last edited by
I installed NodeBB both in my laptop and AWS server. In fact it runs perfectly in my AWS server but it's so wield that I can't upload image in my laptop (I use my laptop as a local development server with wifi network manager wpa_supplicant).
Both my laptop and AWS server run Ubuntu 18.04 server version with the same NodeBB v1.13.4-4, mongo v4.0, NGINX v1.14.0, node v12.17.0, NPM v6.4. Not superuser installation for NodeBB and Git Clone.
AWS Server: basic ufw setup, allow all incoming traffic as well as outgoing traffic.
My Laptop: No firewall ufw, default iptables, able to use express-fileupload in my laptop (and what package does NodeBB use to manage file uploading so that I can use it to build my Plugin?)
The only difference from my point of view is that my laptop operates in LAN and AWS server operates in WAN.
The Error I got from browser:
- No preview.
- Uploading 100%.
- ×Error invalid-files
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) Http://192.168.0.121/api/post/upload
- /nodebb log:
at processTicksAndRejections (internal/process/task_queues.js:83:21) 2020-06-01T17:57:10.353Z [4567/2203] - error: /api/post/upload Error: [[error:invalid-files]] at validateFiles (/home/otnto/nodebb/src/middleware/index.js:107:15) at Layer.handle [as handle_request] (/home/otnto/nodebb/node_modules/express/lib/router/layer.js:95:5) at next (/home/otnto/nodebb/node_modules/express/lib/router/route.js:137:13) at Form.<anonymous> (/home/otnto/nodebb/node_modules/connect-multiparty/index.js:114:7) at Form.emit (events.js:315:20) at emitCloseNT (internal/streams/destroy.js:81:10) at processTicksAndRejections (internal/process/task_queues.js:83:21)
Hope someone know this issue. I'm kind of noob in Linux Server network configuration.
That's not quite the full error in the log you have there. Could you provide a little more context?
Have you checked that any upload-related settings are set up the same on both nodebbs?
What size of file are you uploading?
Are you sure you are on node 12? Uploads are broken on node 14 right now.
Ken John last edited by
You are RIGHT!!!
This problem really came from node version I installed in my laptop. To make "npm link" without sudo I was using nvm to install NodeJS and I forgot to select version 12.17.0.
Great teams. Thanks a lot!