Wiki: Creating Folders and Uploading/Fetching Images Through the Built-In Modal Does Not Work.

Created on 12 Mar 2017  Â·  15Comments  Â·  Source: Requarks/wiki

image

As you can see here, uploading an image gets stuck on "Uploading... 100%"
Not sure if we have an issue with CHOWN or what ¯_(ツ)_/¯
Many thanks! (may be related to #10, but I wasn't sure exactly what happened there, the convo flip-flopped)

bug

All 15 comments

Are you using a web server in front of Wiki.js? e.g. nginx / apache

This usually happens because you uploaded a file larger than the web server upload limits. Right now there's a bug where it just get stuck in this state. This has been fixed in the upcoming release where an error message is displayed.

Yeah, using nginx to reverse proxy. I'll check the upload limit now

Somewhat possibly related; could access rights on repo/uploads be related to this? When I start wiki the access rights keep reverting to this state where the user I run the app with is unable to browse the directory (Ubuntu 16.10)

Testing with funky rights:
chmod -R 777 uploads

Then running pm2 start wiki (as wiki user):
0|wiki | 2017-03-13T12:48:39.203Z - info: [SERVER.Git] Checking Git repository...
0|wiki | 2017-03-13T12:48:40.077Z - info: [SERVER] Starting HTTP/WS server on port 8080...
0|wiki | 2017-03-13T12:48:40.096Z - info: [SERVER] HTTP/WS server started successfully! [RUNNING]
0|wiki | 2017-03-13T12:48:40.176Z - info: [SERVER.Search] Search index flushed and ready.
0|wiki | 2017-03-13T12:48:40.181Z - info: [AGENT] Background Agent is initializing...
0|wiki | 2017-03-13T12:48:40.295Z - info: [SERVER.Git] Git repository is OK.
0|wiki | 2017-03-13T12:48:40.827Z - info: [AGENT.Git] Checking Git repository...
0|wiki | 2017-03-13T12:48:41.299Z - info: [AGENT] Running all jobs...
0|wiki | 2017-03-13T12:48:41.390Z - info: [AGENT.Git] Git repository is OK.
0|wiki | 2017-03-13T12:48:41.392Z - info: [AGENT.Git] Performing pull from remote repository...

[STREAMING] Now streaming realtime logs for [wiki] process
0|wiki | 2017-03-13T12:48:42.895Z - info: [AGENT.Git] Pull completed.
0|wiki | 2017-03-13T12:48:42.905Z - info: [AGENT.Git] Push skipped. Repository is already in sync.
0|wiki | events.js:161
0|wiki | throw er; // Unhandled 'error' event
0|wiki | ^
0|wiki | Error: EACCES: permission denied, lstat '/home/wiki/wikijs/repo/uploads/images'

Checking the rights after startup:
ls -la |grep uploads
drw-r--r-- 3 wiki wiki 4096 Mar 10 08:58 uploads

This causes syncing with the remote repo to stop until a restart of the application 😭

I'm adding this here because I noticed this after seeing the same symptom as originally mentioned.

Same for me too. On /repo/uploads the x flag is getting removed hence node cannot access the files under uploads.

0|wiki | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection: 0|wiki | Error: EACCES: permission denied, mkdir '/home/wiki/wiki/repo/uploads/wiki' 0|wiki | Unhandled rejection Error: EACCES: permission denied, mkdir '/home/wiki/wiki/repo/uploads/wiki' 0|wiki | Unhandled rejection Error: EACCES: permission denied, mkdir '/home/wiki/wiki/repo/uploads/tesy'

Hi.
I have just configured to start wiki.js as root, so access rights should not be a problem. I'm getting error in the logs that sharp module cannot be found. I can't install it using npm because gyp fails.
Do you have any ideas? The error is being thrown during listing folder in the upload dialog. It may be somehow related.
Regards, Dawid.
The trace:
`module.js:472
throw err;
^

Error: Cannot find module 'sharp'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/wiki/wiki.js/libs/uploads-agent.js:11:15)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/wiki/wiki.js/agent.js:32:14)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:425:7)
at startup (bootstrap_node.js:146:9)
at bootstrap_node.js:540:3`

Yeah, I have this error too but I thought it probably doesn't matter. Maybe this is a problem then?

The Cannot find module 'sharp' error occurs because you did not install the Node.js compilation dependencies as required:

https://docs.wiki.requarks.io/prerequisites#node-js-native-compilation-support

Then run npm install && npm rebuild

Uploads will fail if the sharp module can't be loaded.

Beta 9 will completely remove any native compilation dependencies so these errors will be a thing of the past.

@NGPixel I installed node-gyp now. The sharp module error is gone but it still doesn't work (timeout on upload at 100%). The x permissions on the uploads folder is getting removed when starting the wiki hence the directory contents are unreadable by node or git.

The permission bug has been fixed for Beta 9.

@NGPixel thanks. do you have these changes in another repository? I would like to be able to use the fixes already if possible :)

Simply replace the following file /libs/local.js:

https://github.com/Requarks/wiki/blob/master/libs/local.js

@NGPixel I'm using the latest master now, thanks. The permission issue is solved. The uploads work too but the contents of the folders are always shown empty. Are the contents saved in the db btw? Because when I delete them in the repo they are still visible in the UI.

Files and documents contents are not saved in the DB. However, a list of files and their basic metadata is saved in the DB as cache (which is what you see in the Insert Images / Files modals).

If you restart Wiki.js, that cache will be erased and a new list of files will be created based on a folder scan.

The images modal will only show image files (.jpg, .png, .gif), even if you upload other file types.

Can confirm the new local.js fixed this issue for me as well. I bounced the server with a node wiki stop && node wiki start and it accepted a file upload right away and displayed it correctly.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sleepadru picture sleepadru  Â·  4Comments

ccolella-mdc picture ccolella-mdc  Â·  3Comments

sbonaime picture sbonaime  Â·  3Comments

p-se picture p-se  Â·  3Comments

ccolella-mdc picture ccolella-mdc  Â·  3Comments