Successful deployment, but 500 server error

Hi all, just tried my first deployment and it was successful! However, when I go to the production site it says 500 server error, and I don’t really see any logs telling me what’s going on. Any ideas? It’s a nextJS app that’s a pretty basic site. I have one route with an api key that I loaded in the environment variable section of Netlify.

https://master--elizabethjoyfulrealtor.netlify.app/

My deploy settings:
Base directory: /
Package directory: not set
Build Command: npm run build
Publish directory: .next
Functions directory: netlify/functions
Build Status: active

There is the site, any help would be greatly appreciated!

@seth.barthen Try checking your function logs to see if you can spot what it’s dying on.

Thanks, that gave me something. Seems to be complaining about SQLite?

Jun 12, 08:01:41 PM: 51cdda64 TELEMETRY Name: netlify-observability-extension State: Subscribed Types: [Platform, Function]Jun 12, 08:01:41 PM: 51cdda64 2024-06-13T01:01:42.955Z undefined INFO import next server: 295.216msJun 12, 08:01:41 PM: 51cdda64 EXTENSION Name: netlify-observability-extension State: Ready Events: [INVOKE, SHUTDOWN]Jun 12, 08:01:41 PM: 51cdda64 ERROR ⨯ Error: /lib64/libm.so.6: version `GLIBC_2.29’ not found (required by /var/task/node_modules/better-sqlite3/build/Release/better_sqlite3.node)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module._extensions…node (node:internal/modules/cjs/loader:1460:18)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module.load (node:internal/modules/cjs/loader:1203:32)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module._load (node:internal/modules/cjs/loader:1019:12)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module.require (node:internal/modules/cjs/loader:1231:19)Jun 12, 08:01:41 PM: 51cdda64 ERROR at mod.require (/var/task/node_modules/next/dist/server/require-hook.js:65:28)Jun 12, 08:01:41 PM: 51cdda64 ERROR at require (node:internal/modules/helpers:177:18)Jun 12, 08:01:41 PM: 51cdda64 ERROR at bindings (/var/task/node_modules/bindings/bindings.js:112:48)Jun 12, 08:01:41 PM: 51cdda64 ERROR at new Database (/var/task/node_modules/better-sqlite3/lib/database.js:48:64)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Database (/var/task/node_modules/better-sqlite3/lib/database.js:11:10)Jun 12, 08:01:41 PM: 51cdda64 ERROR at 29126 (/var/task/.next/server/app/page.js:1:28318) {Jun 12, 08:01:41 PM: 51cdda64 ERROR code: 'ERR_DLOPEN_FAILED’Jun 12, 08:01:41 PM: 51cdda64 ERROR }Jun 12, 08:01:42 PM: 51cdda64 Duration: 482.68 ms Memory Usage: 134 MB Init Duration: 884.59 ms

I looked into this an it seems like if I add something to the netlify.toml file that it might start working?

[functions]
external_node_modules = [“@libsql/client”]

When I try adding this then push to do another deploy, it doesn’t seem like the site takes the updated .toml file. I don’t see this in the .gitignore, so any idea why it won’t take?

Nope, especially with that stack trace being so poorly formatted.
When pasting in code you should use Fenced Code Blocks.

If it’s originating from the netlify-observability-extension and that’s not something you’ve installed, then I’d imagine it’s an issue Netlify will need to look into.

If it seems SQLite related and it’s something you’re using, then you could investigate along those lines.

Jun 12, 08:01:41 PM: 51cdda64 TELEMETRY Name: netlify-observability-extension State: Subscribed Types: [Platform, Function]Jun 12, 08:01:41 PM: 51cdda64 2024-06-13T01:01:42.955Z undefined INFO import next server: 295.216msJun 12, 08:01:41 PM: 51cdda64 EXTENSION Name: netlify-observability-extension State: Ready Events: [INVOKE, SHUTDOWN]Jun 12, 08:01:41 PM: 51cdda64 ERROR ⨯ Error: /lib64/libm.so.6: version `GLIBC_2.29’ not found (required by /var/task/node_modules/better-sqlite3/build/Release/better_sqlite3.node)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module._extensions…node (node:internal/modules/cjs/loader:1460:18)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module.load (node:internal/modules/cjs/loader:1203:32)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module._load (node:internal/modules/cjs/loader:1019:12)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module.require (node:internal/modules/cjs/loader:1231:19)Jun 12, 08:01:41 PM: 51cdda64 ERROR at mod.require (/var/task/node_modules/next/dist/server/require-hook.js:65:28)Jun 12, 08:01:41 PM: 51cdda64 ERROR at require (node:internal/modules/helpers:177:18)Jun 12, 08:01:41 PM: 51cdda64 ERROR at bindings (/var/task/node_modules/bindings/bindings.js:112:48)Jun 12, 08:01:41 PM: 51cdda64 ERROR at new Database (/var/task/node_modules/better-sqlite3/lib/database.js:48:64)Jun 12, 08:01:41 PM: 51cdda64 ERROR at Database (/var/task/node_modules/better-sqlite3/lib/database.js:11:10)Jun 12, 08:01:41 PM: 51cdda64 ERROR at 29126 (/var/task/.next/server/app/page.js:1:28318) {Jun 12, 08:01:41 PM: 51cdda64 ERROR code: 'ERR_DLOPEN_FAILED’Jun 12, 08:01:41 PM: 51cdda64 ERROR }Jun 12, 08:01:42 PM: 51cdda64 Duration: 482.68 ms Memory Usage: 134 MB Init Duration: 884.59 ms

Sorry hopefully that helps, I had just updated my comment when I think you were responding.

I looked into this an it seems like if I add something to the netlify.toml file that it might start working?

[functions]
external_node_modules = [“@libsql/client”]

I got this added in and now I’m not seeing that error but getting a 404 error. It seems like for some reason the deploy settings are different and maybe throwing this off?

My deploy settings:
Base directory: /
Package directory: not set
Build Command: npm run build
Publish directory: /.next
Functions directory: netlify/functions
Build Status: active

The publish directory is /.next vs the original .next, but it doesn’t seem like I can remove the / is that an issue?

Not really.

You need to put the three ` on their own lines before/after your code.
That way it’ll respect the new lines and you’ll end up with something everyone can read:

Jun 12, 08:01:41 PM: 51cdda64 TELEMETRY Name: netlify-observability-extension State: Subscribed Types: [Platform, Function]
Jun 12, 08:01:41 PM: 51cdda64 2024-06-13T01:01:42.955Z undefined INFO import next server: 295.216ms
Jun 12, 08:01:41 PM: 51cdda64 EXTENSION Name: netlify-observability-extension State: Ready Events: [INVOKE, SHUTDOWN]
Jun 12, 08:01:41 PM: 51cdda64 ERROR ⨯ Error: /lib64/libm.so.6: version `GLIBC_2.29’ not found (required by /var/task/node_modules/better-sqlite3/build/Release/better_sqlite3.node)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module._extensions…node (node:internal/modules/cjs/loader:1460:18)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module.load (node:internal/modules/cjs/loader:1203:32)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module._load (node:internal/modules/cjs/loader:1019:12)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at Module.require (node:internal/modules/cjs/loader:1231:19)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at mod.require (/var/task/node_modules/next/dist/server/require-hook.js:65:28)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at require (node:internal/modules/helpers:177:18)Jun 12, 08:01:41 PM: 51cdda64 ERROR at bindings (/var/task/node_modules/bindings/bindings.js:112:48)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at new Database (/var/task/node_modules/better-sqlite3/lib/database.js:48:64)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at Database (/var/task/node_modules/better-sqlite3/lib/database.js:11:10)
Jun 12, 08:01:41 PM: 51cdda64 ERROR at 29126 (/var/task/.next/server/app/page.js:1:28318) {
Jun 12, 08:01:41 PM: 51cdda64 ERROR code: 'ERR_DLOPEN_FAILED’
Jun 12, 08:01:41 PM: 51cdda64 ERROR }
Jun 12, 08:01:42 PM: 51cdda64 Duration: 482.68 ms Memory Usage: 134 MB Init Duration: 884.59 ms

I see, thanks for the help! So any idea on what I should do next? Something with this netlify-observability-extension? Seems like that update to the .toml file didn’t actually help.

None, my recommendations remain the same as my previous post.

I don’t work for Netlify, don’t work with Next myself and as someone that preferences static sites I personally don’t care much about the kinds of PHP analogous “runtime issues” that tend to be encountered.

You’ll need to wait for assistance from either a Netlify staff member or a community member that likes swimming in runtime errors.

The site appears to be deleted. Do you still need help?