uploaded files do not display in pages in wikijs #3322
Replies: 4 comments 4 replies
-
Suggested solution: this line: await sendFile(cachePath, { dotfiles: 'deny', root: "/opt/wiki/" }) replace with this line: try {
await sendFile(cachePath, { dotfiles: 'deny' })
}catch (error) {
await sendFile(cachePath, { dotfiles: 'deny', root: '/opt/wiki/' })
} |
Beta Was this translation helpful? Give feedback.
-
I have the same symptoms. I've taken a quick look at the sql db using phpmyadmin and the asset entries appear to look fine. So ... I deleted the docker container and started again. Reinstalled and rebuilt a few pages. Exactly the same scenario, all looked OK, then after a couple of days all the assets disappeared again! Very odd indeed. Can you help me diagnose this problem please? I'm happy to try any patch/test version as this is not a production service. Current Version 2.5.276 |
Beta Was this translation helpful? Give feedback.
-
What a waste of time .... Turns out to be a permissions issue. I suspect that when you upload an asset it goes straight into cache and is subsequently loaded from the cache and all looks OK. Unfortunately as time goes by and the cache gets cleared, the asset has to be fetched from disk storage with all the problematic permissions checking etc... I'm not really happy running a container with root permissions, but will do while I test further. |
Beta Was this translation helpful? Give feedback.
-
Hello, I had this problem on my wiki, as well as images being lost between restart (the cache wasn't being regenerated correctly). The root cause was that the path in the "Local File System" configuration option from wiki-js was a relative path of the form "./foobar", and not an absolute one, as required. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Can't access to uploaded files: path must be absolute or specify root to res.sendFile
0|server | 2021-02-06T12:50:35.499Z [MASTER] error: path must be absolute or specify root to res.sendFile
Equals to this problem: #2463 and #2930
To Reproduce
Steps to reproduce the behavior:
Administration -> Utilities -> Flush Pages and Assets Cache
Expected behavior
These videos and pictures do not display
Screenshots
![image](https://user-images.githubusercontent.com/59251666/107141473-2552bc00-693e-11eb-88a1-27a6605f392b.png)
Host Info (please complete the following information):
OS: Linux - Debian (buster) 10 x64
Wiki.js version: 2.5.159
Database engine: PostgreSQL 11.4
Beta Was this translation helpful? Give feedback.
All reactions