mbahArip / next-gdrive-index

Google Drive index built with Next.js for easier sharing files to public.
https://drive-demo.mbaharip.com
GNU Affero General Public License v3.0
64 stars 84 forks source link

File not found #12

Closed aminelazz closed 6 months ago

aminelazz commented 6 months ago

Hello and thank you very much for this beatiful project, i am facing an issue that the content of the root folder is shown, but when i enter to one of the folders it shows this message image

When checked the vercel logs it shows this:

o [Error]: File not found: 1qIAyBL1w49Xg4JTxFvvVGHA9MuhMjrHX.
    at d._request (/var/task/.next/server/chunks/816.js:1:42991)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async n.requestAsync (/var/task/.next/server/chunks/816.js:10:46188)
    at async et (/var/task/.next/server/app/[...rest]/page.js:28:366543)

Note: i've already encrypted the folderID in the config, and changed the env variables and the Vercel's environment variables naming too

mbahArip commented 6 months ago
  1. Have you tried to redeploy the app? Vercel need to redeploy everytime you change environment or serverless region
  2. Make sure you've already share the folder with your service account
aminelazz commented 6 months ago
  1. Have you tried to redeploy the app? Vercel need to redeploy everytime you change environment or serverless region
  2. Make sure you've already share the folder with your service account
  1. I guess it redeploys everytime i commit something.
  2. As i said, it does show the content of the root folder, but when i try to enter to one of the sub folders it shows that error. So it's not a sharing problem 'cause the service account already has access to the root folder.

And thank you for the fast reply, Have a nice day

mbahArip commented 6 months ago

Now that's a weird one...

Does your folder have the same folder name / file? Or does the folder are saved inside shared drive? If it's ok, can you drop your deployment URL here?

aminelazz commented 6 months ago

Now that's a weird one...

Does your folder have the same folder name / file? Or does the folder are saved inside shared drive? If it's ok, can you drop your deployment URL here?

The root folder that i am using to show its content and the sub-folders have different names. And yes, it's a shared drive.

Deployment URL (i guess you have to be connected to my account to access it): https://raws-index-p8k3sm41v-aminelazzs-projects.vercel.app

Production URL: https://raws-index.vercel.app/

mbahArip commented 6 months ago

It might be shared drive that cause the issues, since I haven't tested it on the v2. Can you try to use your own drive to check if it's actually the shared drive that causing this error?

mbahArip commented 6 months ago

I've pushed a new fix branch Can you try using this branch and see if it's fixed the issue?

aminelazz commented 6 months ago

It might be shared drive that cause the issues, since I haven't tested it on the v2. Can you try to use your own drive to check if it's actually the shared drive that causing this error?

I tried a personal drive folder and added the service account, it doesn't show the the root folder content. image

But whent i type the name of a subfolder in the URL it shows its content

image

Which is actually weird lol

aminelazz commented 6 months ago

I've pushed a new fix branch Can you try using this branch and see if it's fixed the issue?

It seems that I can only fork the main branch

mbahArip commented 6 months ago

Which is actually weird lol

It's getting more weird 😂

It seems that I can only fork the main branch

can you try replace the /src/app/actions.ts with the one from the new branch?

aminelazz commented 6 months ago

can you try replace the /src/app/actions.ts with the one from the new branch?

After replacing it, the personal drive folder issue has been fixed.

But another error appeared after switching to the shared drive, the vercel logs show: Shared drive not found: **the encrypted folder id** image

mbahArip commented 6 months ago

Welp. It's kinda hard for me to test it. I'll search some cheap shared drive for now to test it, expect the fix in couple of days.

aminelazz commented 6 months ago

Welp. It's kinda hard for me to test it. I'll search some cheap shared drive for now to test it, expect the fix in couple of days.

No problem, take your time. And thank you for your assistance, have a nice day

mbahArip commented 6 months ago

Just got my hand on shared drive. With quick test, browse, preview, and downloading files work as intended. But I'll check more thoroughly in the evening (GMT+7) and will merge at midnight if there are no issues. image

mbahArip commented 6 months ago

Should be fixed on latest commit. The demo site should be using the files from my shared drive now if you want to check it.

You need to add the shared drive ID to the config > apiConfig > sharedDrive and you need to add your service account to your shared drive member. (If you're not, somehow it won't load the files on root even though it's already inside a new folder) image

If you found any issues, you can create a new issue or reopen this issue.