collectives icon indicating copy to clipboard operation
collectives copied to clipboard

Cannot access collection anymore

Open rrrnld opened this issue 2 years ago • 10 comments

Describe the bug I cannot open my collection anymore. Instead, I always see: "Page not found: {page}", with no option to change to a different page

To Reproduce Steps to reproduce the behavior:

  1. Create new page
  2. Click on 'Open in files'
  3. Create a folder with the same name

Now, no matter what I do, I end up with the message above. The files are still on the disk, but I can't open them in the Collectives app anymore.

Expected behavior I wanted to copy a README.md from one folder to another.

Screenshots If applicable, add screenshots to help explain your problem.

Client details:

  • OS: [e.g. iOS] Linux
  • Browser: [e.g. chrome, safari] Firefox
  • Version: [e.g. 24] 118
  • Device: [e.g. iPhone6, desktop] Laptop
Server details

Collectives app version: (see Nextcloud apps page) 2.8.2

Operating system: Linux 5.15.0-78-generic

Web server: nginx version: nginx/1.18.0

**Database:**mysql Ver 15.1 Distrib 10.6.12-MariaDB

PHP version: 8.2.8

Nextcloud version: (see Nextcloud admin page) 27.1.2

Logs

Nextcloud log (data/nextcloud.log)

{"reqId":"M2hqaTljgHQACDQsJNQ2","level":3,"time":"2023-10-15T13:17:09+00:00","remoteAddr":"xxx","user":"arne","app":"collectives","method":"PATCH","url":"/apps/collectives/_api/4/_pages/trash/3255474","message":"Collectives App Error: Call to a member function getId() on null","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0","version":"27.1.2.1","exception":{"Exception":"Error","Message":"Call to a member function getId() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/collectives/lib/Service/PageService.php","line":899,"function":"getTrashItemByCollectiveAndId","class":"OCA\\Collectives\\Trash\\PageTrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/collectives/lib/Controller/PageTrashController.php","line":67,"function":"restore","class":"OCA\\Collectives\\Service\\PageService","type":"->"},{"file":"/var/www/nextcloud/apps/collectives/lib/Controller/ErrorHelper.php","line":27,"function":"OCA\\Collectives\\Controller\\{closure}","class":"OCA\\Collectives\\Controller\\PageTrashController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/collectives/lib/Controller/PageTrashController.php","line":65,"function":"handleErrorResponse","class":"OCA\\Collectives\\Controller\\PageTrashController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"restore","class":"OCA\\Collectives\\Controller\\PageTrashController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/collectives/lib/Trash/PageTrashBackend.php","Line":548,"message":"Collectives App Error: Call to a member function getId() on null","exception":[],"CustomMessage":"Collectives App Error: Call to a member function getId() on null"},"id":"652be7fc088fc"}

Browser log

No relevant network or JS console logs

rrrnld avatar Oct 15 '23 13:10 rrrnld

Dear @heyarne, thanks for your report. Could you provide further details how you produced the issue?

What do you mean with "Create a folder with the same name"?

You open the collective folder in the Files app. Where exactly do you create a new folder, and how do you name it? Could you provide a screenshot please?

Also, did removing the folder via the Files app solve the issue for you?

mejo- avatar Oct 24 '23 14:10 mejo-

Hi @mejo-, thanks for coming back to this issue.

I have a collective, let's just name it "Foo". This collective had two subfolders with files like this:

├── A
│   ├── Readme.md
│   ├── File 1.md
│   └── File 2.md
└── B
    ├── Readme.md
    ├── File 1.md
    └── File 2.md

I wanted to create a folder C with two files in it, analogous to A and B. So I created a new Note C, only to realize there's no easy way for me to copy File 1.md and File 2.md to the new note. So I opened the Collectives folder in the Files app and saw this structure:

├── A
│   ├── Readme.md
│   ├── File 1.md
│   └── File 2.md
├── B
│   ├── Readme.md
│   ├── File 1.md
│   └── File 2.md
└── C.md

I created a folder C, and this is where it broke. I was not able to restore access to this collective, no matter which files I deleted (or recreated). I also tried running the different occ collectives:... commands. Is there a way to just import a collective from a file structure? That would restore my access, even though the underyling bug would remain.

rrrnld avatar Oct 24 '23 15:10 rrrnld

Thanks for the additional info, @heyarne. Unfortunately I was not able to reproduce your issue yet. I created a collective with the page structure as described in your second file tree. Then I added a folder "C" via the files app.

Only after additionally adding a markdown file to the folder "C", the collectives app choke on the structure, but it didn't break displaying the pages.

I wonder especially that you write "I was not able to restore access to this collective, no matter which files I deleted (or recreated)". If the problem was that both folder C and markdown file C.md existed on the same hierarchy level (which indeed is a problem and should be avoided), then removing one of the two should have solved the issue.

Did you delete the files via the Nextcloud Files app, or did you remove them directly on the filesystem (on the server)? If the latter, then Nextcloud might not be aware that the files got deleted. occ files:scan-app-data might help in that case.

In any case, could you please do the following:

  • Open the web console of your browser (Ctrl-Shift-I on Firefox/Chrome), open the broken collective and send us any errors or warnings being logged there.
  • Send us relevant logs from the nextcloud.log file on your server that appear while experiencing the issue.

mejo- avatar Oct 24 '23 15:10 mejo-

The JS Log is empty -- it only shows some unrelated stuff about Y.js already being loaded and so on. /apps/collectives/_api/4/_pages and /apps/collectives/_api/4/_pages/trash both respond with {"data": []} (all files still being present). /settings/admin/logging shows no logs related to the Collectives app when I try to access the notes again. I can find a couple of very similar log entries like the one below for earlier today:

{"reqId":"gKEZQvfB2DUoT23oy1fL","level":3,"time":"2023-10-15T13:17:16+00:00","remoteAddr":"xxx","user":"xxx","app":"collectives","method":"PATCH","url":"/apps/collectives/_api/4/_pages/trash/3210001","message":"Collectives App Error: Call to a member function getId() on null","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0","version":"27.1.2.1","exception":{"Exception":"Error","Message":"Call to a member function getId() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/collectives/lib/Service/PageService.php","line":899,"function":"getTrashItemByCollectiveAndId","class":"OCA\\Collectives\\Trash\\PageTrashBackend","type":"->"},{"file":"/var/www/nextcloud/apps/collectives/lib/Controller/PageTrashController.php","line":67,"function":"restore","class":"OCA\\Collectives\\Service\\PageService","type":"->"},{"file":"/var/www/nextcloud/apps/collectives/lib/Controller/ErrorHelper.php","line":27,"function":"OCA\\Collectives\\Controller\\{closure}","class":"OCA\\Collectives\\Controller\\PageTrashController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/collectives/lib/Controller/PageTrashController.php","line":65,"function":"handleErrorResponse","class":"OCA\\Collectives\\Controller\\PageTrashController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"restore","class":"OCA\\Collectives\\Controller\\PageTrashController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/collectives/lib/Trash/PageTrashBackend.php","Line":548,"message":"Collectives App Error: Call to a member function getId() on null","exception":{},"CustomMessage":"Collectives App Error: Call to a member function getId() on null"}}

This is similar to the log entry I attached above.

I wonder especially that you write "I was not able to restore access to this collective, no matter which files I deleted (or recreated)". If the problem was that both folder C and markdown file C.md existed on the same hierarchy level (which indeed is a problem and should be avoided), then removing one of the two should have solved the issue.

I can't say for sure anymore because this is now already some days ago, but I'm pretty sure the first thing I tried was removing C with all files inside it, restoring the structure that was created by the Collectives before I did any modifications from within the Files app.

Did you delete the files via the Nextcloud Files app, or did you remove them directly on the filesystem (on the server)? If the latter, then Nextcloud might not be aware that the files got deleted. occ files:scan-app-data might help in that case.

All of the modifications were always done from within the Files app, thorugh the web interface.

rrrnld avatar Oct 25 '23 18:10 rrrnld

Sorry for the long delay with my response. So you still see all files of the collective via the Files app, right? Could you try to move all files and folders except the top-level Readme.md from the folder of this collective somewhere else (ideally somewhere not below your Collectives folder) and see whether this solves your problem?

mejo- avatar Nov 08 '23 12:11 mejo-

@mejo- :bulb: There was no top-level Readme.md. I created it and now everything works fine again. :) So the error was raised by opening a Collective without a Readme? Thanks for helping me debu this!

rrrnld avatar Nov 08 '23 17:11 rrrnld

Great to hear that we could solve the problem for you. But Collectives should restore itself from a missing top-level Readme.md file. Could you try again creating a test collective, removing the top-level Readme.md via the Files app and see whether this breaks the collective for you?

mejo- avatar Nov 09 '23 12:11 mejo-

Yes, it does break it:

  1. I created a new collective foobar
  2. I move the "Readme.md" out of the Collectives folder
  3. I receive the error message: " Page not found: {page} Select a page from the list or create a new one. "

Nothing on the right side is loading:

image

rrrnld avatar Nov 09 '23 13:11 rrrnld

almost the same happens to me on Brave, but just the content of the public page is not showing .. only recent pages and Landing page 😩 i'm so upset about this stuff

EVERY page content is not displayed - but sometimes it works ..

Capture d’écran 2023-11-15 à 19 59 37

Capture d’écran 2023-11-15 à 20 00 01

punkyard avatar Nov 15 '23 19:11 punkyard

@punkyard this ticket is about issues with "Page not found" errors after deleting the top-level Readme.md file of a collective. Please keep your posts to the respective issue, you already opened one about your issue with empty pages in public shares (and were able to resolve it, yay!).

mejo- avatar Nov 15 '23 22:11 mejo-