Missing Attachemens after reorganisation #5082

Closed
opened 2026-02-05 09:38:51 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @werksfarbe on GitHub (Dec 13, 2024).

Describe the Bug

Hi Folks
We have reorganized our wiki. There are many explanatory videos in the wiki. Unfortunately, the videos are now missing from almost all pages. Error 404. However, the video code is still included on the page: . When I look into the database, the entry is still there and the file is also present. What happened?

We still use BookStack v23.06.2 (update is planed end of dezember)
Can you help me here to fix this? or would an update fix the issue?

Thank

Tom

Steps to Reproduce

Visiting a Website with a embetted video file

Expected Behaviour

videofile is avalible

Screenshots or Additional Context

Bildschirmfoto 2024-12-13 um 14 19 30

Browser Details

all

Exact BookStack Version

v23.06.2

Originally created by @werksfarbe on GitHub (Dec 13, 2024). ### Describe the Bug Hi Folks We have reorganized our wiki. There are many explanatory videos in the wiki. Unfortunately, the videos are now missing from almost all pages. Error 404. However, the video code is still included on the page: <video controls="controls" width="1280" height="640"><source src="https://xxxxxxx.de/attachments/39" data-mce-fragment="1"></video>. When I look into the database, the entry is still there and the file is also present. What happened? We still use BookStack v23.06.2 (update is planed end of dezember) Can you help me here to fix this? or would an update fix the issue? Thank Tom ### Steps to Reproduce Visiting a Website with a embetted video file ### Expected Behaviour videofile is avalible ### Screenshots or Additional Context <img width="965" alt="Bildschirmfoto 2024-12-13 um 14 19 30" src="https://github.com/user-attachments/assets/a0da19fc-6e00-4458-90a7-d55ca43e76f6" /> ### Browser Details all ### Exact BookStack Version v23.06.2
OVERLORD added the 🐕 Support label 2026-02-05 09:38:51 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Dec 13, 2024):

Hi @werksfarbe,
Do you have visibility of the page which the video was originally uploaded to as an attachment?

@ssddanbrown commented on GitHub (Dec 13, 2024): Hi @werksfarbe, Do you have visibility of the page which the video was originally uploaded to as an attachment?
Author
Owner

@werksfarbe commented on GitHub (Dec 16, 2024):

Hi @ssddanbrown
the pages are there with the video-html-code (but not videos displayed)
the video-files are not on the pages as an attachment. I see them only in the database and in the file strukte.
At this moment i saw that its happening not only with videos but wuth all attachement like .zip.

Tom

@werksfarbe commented on GitHub (Dec 16, 2024): Hi @ssddanbrown the pages are there with the video-html-code (but not videos displayed) the video-files are not on the pages as an attachment. I see them only in the database and in the file strukte. At this moment i saw that its happening not only with videos but wuth all attachement like .zip. Tom
Author
Owner

@ssddanbrown commented on GitHub (Dec 16, 2024):

@werksfarbe

Can you follow the below steps:

  • Find the attachment row in the database.
  • Find the value of the uploaded_to column for that row.
  • Go to <bookstack-base-path>/link/<value-from-last-step>
    • Do you see an accessible page without any errors?

Also:

  • Did you touch any filesystem files as part of your reorganisation?
  • can you confirm the exact full filesystem path to the video that you can find in the filestructure?
@ssddanbrown commented on GitHub (Dec 16, 2024): @werksfarbe Can you follow the below steps: - Find the attachment row in the database. - Find the value of the `uploaded_to` column for that row. - Go to `<bookstack-base-path>/link/<value-from-last-step>` - Do you see an accessible page without any errors? Also: - Did you touch any filesystem files as part of your reorganisation? - can you confirm the exact full filesystem path to the video that you can find in the filestructure?
Author
Owner

@werksfarbe commented on GitHub (Dec 16, 2024):

Hi @ssddanbrown

first of all big thanks for your time and your help here!

I opened a Problematic page. the ID of the attachment in the video-HTML-Tag is "66" so attachments/66. The ID in the Row uploaded_to is 303. When i go to /link/303 i get an 404 error.

Bildschirmfoto 2024-12-16 um 17 58 21

The path of the physical file is <server>/BookStack/storage/uploads/files/2024-06-Jun/ul4F9GiQArz4mZBE-mp4
The file is there and avalible. I can download it - add suffix .mp4 and its useable again.

To check a littlebit more i looked for the page ID.
Bildschirmfoto 2024-12-16 um 18 08 05

Like you see here the page ID issnt 303 but 390.

I dont made any changes in the file system.

is there maybe a way to reconnect the pages to the attchement?

Update: What i did - i gave a friend of mine more access to the wiki so she can edit, move and delete pages. for this i create a new user role with permissions

@werksfarbe commented on GitHub (Dec 16, 2024): Hi @ssddanbrown **first of all big thanks for your time and your help here!** I opened a Problematic page. the ID of the attachment in the video-HTML-Tag is "66" so `attachments/66`. The ID in the Row `uploaded_to` is 303. When i go to /link/303 i get an 404 error. <img width="1731" alt="Bildschirmfoto 2024-12-16 um 17 58 21" src="https://github.com/user-attachments/assets/77099693-7a42-4317-9afd-31ca69df59c4" /> The path of the physical file is `<server>/BookStack/storage/uploads/files/2024-06-Jun/ul4F9GiQArz4mZBE-mp4` The file is there and avalible. I can download it - add suffix .mp4 and its useable again. To check a littlebit more i looked for the page ID. <img width="1947" alt="Bildschirmfoto 2024-12-16 um 18 08 05" src="https://github.com/user-attachments/assets/2af54021-f78b-4ce2-95f2-ca10fe8dbda2" /> Like you see here the page ID issnt 303 but 390. I dont made any changes in the file system. is there maybe a way to reconnect the pages to the attchement? Update: What i did - i gave a friend of mine more access to the wiki so she can edit, move and delete pages. for this i create a new user role with permissions
Author
Owner

@ssddanbrown commented on GitHub (Dec 17, 2024):

@werksfarbe The attachment would have been uploaded to page 303, so visibility of the attachment depends on access to that page. Since you can't see it, but the attachment still exists, that probably means on of the following:

  • The page has been deleted but is in the recycle bin.
    • If this, When the recycle bin is emptied the attachment will be deleted.
  • You don't have user/role permissions to see the page.
  • There's been a permission generation issue, hiding the page.

If you really needed to, you could change the uploaded_to for the attachment to be a different page ID, although it's not something I've tested nor is officially supported at all.

@ssddanbrown commented on GitHub (Dec 17, 2024): @werksfarbe The attachment would have been uploaded to page 303, so visibility of the attachment depends on access to that page. Since you can't see it, but the attachment still exists, that probably means on of the following: - The page has been deleted but is in the recycle bin. - If this, When the recycle bin is emptied the attachment will be deleted. - You don't have user/role permissions to see the page. - There's been a permission generation issue, hiding the page. If you really needed to, you could change the `uploaded_to` for the attachment to be a different page ID, although it's not something I've tested nor is officially supported at all.
Author
Owner

@werksfarbe commented on GitHub (Dec 17, 2024):

Oh my... you are right. instead of moving an page she create a new one, makes copy&paste and delete the old one - but of course without the attachements
oh 💩

@werksfarbe commented on GitHub (Dec 17, 2024): Oh my... you are right. instead of moving an page she create a new one, makes copy&paste and delete the old one - but of course without the attachements oh 💩
Author
Owner

@ssddanbrown commented on GitHub (Dec 17, 2024):

Yeah, that'd do it! Should be able to restore from the recycle bin, before it gets deleted forever!

Since this mystery is solved, I'll go ahead and close off this issue.

@ssddanbrown commented on GitHub (Dec 17, 2024): Yeah, that'd do it! Should be able to restore from the recycle bin, before it gets deleted forever! Since this mystery is solved, I'll go ahead and close off this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5082