core icon indicating copy to clipboard operation
core copied to clipboard

Production Hub Database UI shows error

Open sosensible opened this issue 1 year ago • 12 comments

Describe the bug Database shows for build previews but production is broke. It said... Unexpected error happened 😕 Please download error context and report to our support team

Steps to reproduce Steps to reproduce the behavior:

  1. Starting with a working Drizzle project
  2. Update the schema... but had local issue...
  3. Deleted schema files to match production, deleted migration entries in DB... got it working
  4. Deployed to preview on Hub and worked...
  5. Deployed to production... it works but the DB interface in Hub admin broke

Expected behavior Works like before... like preview... like dev... without the error. :)

sosensible avatar Feb 15 '25 15:02 sosensible

Here is the bug report it said to send. bug-report.zip

sosensible avatar Feb 15 '25 15:02 sosensible

This error generally means that there's an issue connecting to the production deployment in order to query the database from it. Please could you check the network tab of your browser devtools?

RihanArfan avatar Feb 15 '25 15:02 RihanArfan

There were no errors, but it was listed as an access-restricted app via CloudFlare Zero Access. Changing that resolved the issue.

Should we, or is there a way to work around that for non-public-facing solutions?

sosensible avatar Feb 17 '25 20:02 sosensible

Take a look at our guide for using Cloudflare Access with NuxtHub https://hub.nuxt.com/docs/recipes/cloudflare-access

RihanArfan avatar Feb 17 '25 22:02 RihanArfan

I already have my site deployed on Cloudflare via NuxtHub. Integrating the database without messing up the automated migration is the challenge.

sosensible avatar Feb 18 '25 16:02 sosensible

I also get an error on the Database tab in the Nuxthub admin panel. Already recreated the app from scratch by deleting the whole app, but I still have the same issue. The strangest part is that the databases can be seen from Cloudflare.

bug-report 2.zip

50rayn avatar Apr 01 '25 04:04 50rayn

I'm getting the same error as @50rayn in both admin panel and devtools. I think this is a different one to OP but would be great if someone from the team looks into it.

Pasting the error here to help with SEO in case there's more of us.

(p.sql.matchAll(w)||[]).forEach is not a function. (In '(p.sql.matchAll(w)||[]).forEach(k=>{const H=k[1],F=k[2].split(",").map(Z=>ll(Z.trim()));b[H]={id:`public.${p.name}.${H}`,name:H,type:"primary",schema:"public",table:p.name,columns:F}})', '(p.sql.matchAll(w)||[]).forEach' is undefined)

PiuPiuson avatar Apr 03 '25 14:04 PiuPiuson

Hello, I have the same error... (p.sql.matchAll(w)||[]).forEach is not a function. (In '(p.sql.matchAll(w)||[]).forEach(k=>{const H=k[1],F=k[2].split(",").map(Z=>ll(Z.trim()));b[H]={id:public.${p.name}.${H},name:H,type:"primary",schema:"public",table:p.name,columns:F}})

Ambrise avatar May 08 '25 21:05 Ambrise

Please could you let me know the browser (including version) you're using to access the database? If it's Safari, ensure your macOS is up to date.

RihanArfan avatar May 09 '25 07:05 RihanArfan

Is the issue still occurring? @sosensible @50rayn @PiuPiuson @Ambrise

RihanArfan avatar May 26 '25 01:05 RihanArfan

I was using Windows with Edge, updated. I don't remember which project it was, and should have noted that. So I checked all my projects and found these issues. It was so long ago, I am not sure it is the same issue, but it is the only one I found.

bug-report (1).zip

sosensible avatar May 26 '25 12:05 sosensible

@RihanArfan I have checked the latest version of nuxthub (version 0.8.27) on Safari Version 18.5 (20621.2.5.11.8). Everything works fine for me 👍🏻 . Thanks for the fixes.

P.S. I paused for a little while using Nuxthub, due to its beta state. I loved a lot the ease of deployments, but a couple of things stopped me from using for a while the next hub. Things like:

  • emailing - #519
  • scheduled tasks, a.k.a. cron job - as I found, there are only workaround

50rayn avatar May 26 '25 12:05 50rayn