Parse-Server on Heroku - node.js

I am trying to set up Parse-Server on Heroku along with MongoDB, starting from the classic https://github.com/parse-community/parse-server-example.git.
After going up to a certain point I hit this problem where I can see the following in the logs:
... app[web.1]: MongoServerError: user is not allowed to do action [find] on [test._SCHEMA]
... app[web.1]: at MessageStream.messageHandler (/app/node_modules/parse-server/node_modules/mongodb/lib/cmap/connection.js:462:30)
... app[web.1]: at MessageStream.emit (node:events:513:28)
... app[web.1]: at processIncomingData (/app/node_modules/parse-server/node_modules/mongodb/lib/cmap/message_stream.js:108:16)
... app[web.1]: at MessageStream._write (/app/node_modules/parse-server/node_modules/mongodb/lib/cmap/message_stream.js:28:9)
... app[web.1]: at writeOrBuffer (node:internal/streams/writable:392:12)
... app[web.1]: at _write (node:internal/streams/writable:333:10)
... app[web.1]: at Writable.write (node:internal/streams/writable:337:10)
... app[web.1]: at TLSSocket.ondata (node:internal/streams/readable:766:22)
... app[web.1]: at TLSSocket.emit (node:events:513:28)
... app[web.1]: at addChunk (node:internal/streams/readable:324:12) {
... app[web.1]: ok: 0,
... app[web.1]: code: 8000,
... app[web.1]: codeName: 'AtlasError'
Why do I get this .... user is not allowed to do action [find] on [test._SCHEMA]
Any idea of how to deal with this problem ?

Related

Getting Error on Heroku Failed to launch chrome

I'm using Puppeteer on Heroku and I receive the following error:
2022-10-03T16:51:52.616196+00:00 app[web.1]: Error: Failed to launch the browser process!
2022-10-03T16:51:52.616214+00:00 app[web.1]: [1003/165152.260124:FATAL:zygote_host_impl_linux.cc(117)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
2022-10-03T16:51:52.616214+00:00 app[web.1]: #0 0x55894fa52339 base::debug::CollectStackTrace()
2022-10-03T16:51:52.616215+00:00 app[web.1]: #1 0x55894f9c8f23 base::debug::StackTrace::StackTrace()
2022-10-03T16:51:52.616215+00:00 app[web.1]: #2 0x55894f9c6070 logging::LogMessage::~LogMessage()
2022-10-03T16:51:52.616215+00:00 app[web.1]: #3 0x55894d9c6c2b content::ZygoteHostImpl::Init()
2022-10-03T16:51:52.616216+00:00 app[web.1]: #4 0x55894f543c0f content::ContentMainRunnerImpl::Initialize()
2022-10-03T16:51:52.616216+00:00 app[web.1]: #5 0x55894f541bfd content::RunContentProcess()
2022-10-03T16:51:52.616216+00:00 app[web.1]: #6 0x55894f541d4e content::ContentMain()
2022-10-03T16:51:52.616217+00:00 app[web.1]: #7 0x55894f59920a headless::(anonymous namespace)::RunContentMain()
2022-10-03T16:51:52.616218+00:00 app[web.1]: #8 0x55894f598f15 headless::HeadlessShellMain()
2022-10-03T16:51:52.616219+00:00 app[web.1]: #9 0x55894be7a1e3 ChromeMain
2022-10-03T16:51:52.616219+00:00 app[web.1]: #10 0x7f8e87025d90 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
2022-10-03T16:51:52.616219+00:00 app[web.1]: #11 0x7f8e87025e40 __libc_start_main
2022-10-03T16:51:52.616220+00:00 app[web.1]: #12 0x55894be7a02a _start
2022-10-03T16:51:52.616221+00:00 app[web.1]:
2022-10-03T16:51:52.616222+00:00 app[web.1]:
2022-10-03T16:51:52.616222+00:00 app[web.1]:
2022-10-03T16:51:52.616222+00:00 app[web.1]: TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
2022-10-03T16:51:52.616223+00:00 app[web.1]:
2022-10-03T16:51:52.616223+00:00 app[web.1]: at onClose (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:286:20)
2022-10-03T16:51:52.616224+00:00 app[web.1]: at Interface.<anonymous> (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:274:24)
2022-10-03T16:51:52.616224+00:00 app[web.1]: at Interface.emit (node:events:525:35)
2022-10-03T16:51:52.616225+00:00 app[web.1]: at Interface.close (node:readline:590:8)
2022-10-03T16:51:52.616225+00:00 app[web.1]: at Socket.onend (node:readline:280:10)
2022-10-03T16:51:52.616225+00:00 app[web.1]: at Socket.emit (node:events:525:35)
2022-10-03T16:51:52.616226+00:00 app[web.1]: at endReadableNT (node:internal/streams/readable:1358:12)
2022-10-03T16:51:52.616226+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:83:21)
My Code:
const browser = await puppeteer.launch({
args: ["--no-sandbox", "--disable-setuid-sandbox"],
});
puppeteer heroku buildpack installed !
I tried some solutions but I was not successful.

mac os, after npm update I get strange errors, when I open a terminal

When I start new terminal - I see the error.
I press Enter - and then I can work normally.
Why this happens and how to fix this?
apower ~/Desktop/t1 node:events:505
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:823:11)
at Socket._write (node:net:835:8)
at writeOrBuffer (node:internal/streams/writable:390:12)
at _write (node:internal/streams/writable:331:10)
at Writable.write (node:internal/streams/writable:335:10)
at SafeSubscriber._next (/usr/local/lib/node_modules/#angular/cli/node_modules/#angular-devkit/core/node/cli-logger.js:52:20)
at SafeSubscriber.__tryOrUnsub (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/Subscriber.js:205:16)
at SafeSubscriber.next (/usr/local/lib/node_modules/#angular/cli/node_modules/rxjs/internal/Subscriber.js:143:22)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
}
Node.js v18.2.0
apower ~/Desktop/t1
apower ~/Desktop/t1 npm -v
8.12.1
apower ~/Desktop/t1 node -v
v18.2.0

Laravel 8 and JetStream npm run dev error in windows

npm run dev
cmd error
[enter image description henter image description hereere]2
node:events:498
throw er; // Unhandled 'error' event
^
Error: write EIO
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at WriteStream.Socket._writeGeneric (node:net:795:11)
at WriteStream.Socket._write (node:net:807:8)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at WriteStream.Writable.write (node:internal/streams/writable:334:10)
at LogUpdate.write (C:\wamp64\www\hospital_app\node_modules\webpackbar\dist\index.cjs:1384:35)
at LogUpdate.render (C:\wamp64\www\hospital_app\node_modules\webpackbar\dist\index.cjs:1374:10)
at FancyReporter._renderStates (C:\wamp64\www\hospital_app\node_modules\webpackbar\dist\index.cjs:1456:15)
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4070,
code: 'EIO',
syscall: 'write'
node and npm version are
C:\wamp64\www\hospital_app>node -v
v16.14.0
C:\wamp64\www\hospital_app>npm -v
8.3.1
pls help me to solve this ?

Node.JS app crash on startup after second deployment on Heroku

I did git push heroku master for the second time.
But I got the error cannot find module ....
For the first time, I succeeded.
How can I fix this? Thanks.
2021-01-03T16:03:35.301824+00:00 app[web.1]: internal/modules/cjs/loader.js:818
2021-01-03T16:03:35.301837+00:00 app[web.1]: throw err;
2021-01-03T16:03:35.301837+00:00 app[web.1]: ^
2021-01-03T16:03:35.301837+00:00 app[web.1]:
2021-01-03T16:03:35.301838+00:00 app[web.1]: Error: Cannot find module './stringToParts'
2021-01-03T16:03:35.301838+00:00 app[web.1]: Require stack:
2021-01-03T16:03:35.301839+00:00 app[web.1]: - /app/node_modules/mpath/lib/index.js
2021-01-03T16:03:35.301839+00:00 app[web.1]: - /app/node_modules/mpath/index.js
2021-01-03T16:03:35.301839+00:00 app[web.1]: - /app/node_modules/mongoose/lib/utils.js
2021-01-03T16:03:35.301840+00:00 app[web.1]: - /app/node_modules/mongoose/lib/statemachine.js
2021-01-03T16:03:35.301841+00:00 app[web.1]: - /app/node_modules/mongoose/lib/internal.js
2021-01-03T16:03:35.301841+00:00 app[web.1]: - /app/node_modules/mongoose/lib/document.js
2021-01-03T16:03:35.301841+00:00 app[web.1]: - /app/node_modules/mongoose/lib/index.js
2021-01-03T16:03:35.301842+00:00 app[web.1]: - /app/node_modules/mongoose/index.js
2021-01-03T16:03:35.301842+00:00 app[web.1]: - /app/models/user.js
2021-01-03T16:03:35.301843+00:00 app[web.1]: - /app/controllers/usersController.js
2021-01-03T16:03:35.301843+00:00 app[web.1]: - /app/routes/userRoutes.js
2021-01-03T16:03:35.301844+00:00 app[web.1]: - /app/routes/index.js
2021-01-03T16:03:35.301845+00:00 app[web.1]: - /app/main.js
2021-01-03T16:03:35.301845+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
2021-01-03T16:03:35.301846+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:667:27)
2021-01-03T16:03:35.301846+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:887:19)
2021-01-03T16:03:35.301847+00:00 app[web.1]: at require (internal/modules/cjs/helpers.js:74:18)
2021-01-03T16:03:35.301847+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/mpath/lib/index.js:1:21)
2021-01-03T16:03:35.301848+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:999:30)
2021-01-03T16:03:35.301848+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
2021-01-03T16:03:35.301849+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:863:32)
2021-01-03T16:03:35.301849+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:708:14)
2021-01-03T16:03:35.301849+00:00 app[web.1]: at Module.require (internal/modules/cjs/loader.js:887:19) {
2021-01-03T16:03:35.301850+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2021-01-03T16:03:35.301850+00:00 app[web.1]: requireStack: [
2021-01-03T16:03:35.301851+00:00 app[web.1]: '/app/node_modules/mpath/lib/index.js',
2021-01-03T16:03:35.301851+00:00 app[web.1]: '/app/node_modules/mpath/index.js',
2021-01-03T16:03:35.301851+00:00 app[web.1]: '/app/node_modules/mongoose/lib/utils.js',
2021-01-03T16:03:35.301852+00:00 app[web.1]: '/app/node_modules/mongoose/lib/statemachine.js',
2021-01-03T16:03:35.301852+00:00 app[web.1]: '/app/node_modules/mongoose/lib/internal.js',
2021-01-03T16:03:35.301852+00:00 app[web.1]: '/app/node_modules/mongoose/lib/document.js',
2021-01-03T16:03:35.301853+00:00 app[web.1]: '/app/node_modules/mongoose/lib/index.js',
2021-01-03T16:03:35.301853+00:00 app[web.1]: '/app/node_modules/mongoose/index.js',
2021-01-03T16:03:35.301853+00:00 app[web.1]: '/app/models/user.js',
2021-01-03T16:03:35.301854+00:00 app[web.1]: '/app/controllers/usersController.js',
2021-01-03T16:03:35.301854+00:00 app[web.1]: '/app/routes/userRoutes.js',
2021-01-03T16:03:35.301855+00:00 app[web.1]: '/app/routes/index.js',
2021-01-03T16:03:35.301855+00:00 app[web.1]: '/app/main.js'
2021-01-03T16:03:35.301855+00:00 app[web.1]: ]
2021-01-03T16:03:35.301856+00:00 app[web.1]: }
2021-01-03T16:03:35.394395+00:00 heroku[web.1]: Process exited with status 1
2021-01-03T16:03:35.475189+00:00 heroku[web.1]: State changed from starting to crashed
2021-01-03T16:03:35.479175+00:00 heroku[web.1]: State changed from crashed to starting
2021-01-03T16:03:39.720428+00:00 heroku[web.1]: Starting process with command `node main.js`
Are you exporting the data in './stringToParts' correctly?
When you require a module like './stringToParts', it must be exported.
Check if you have something like this at the end of your './stringToParts' file:
module.exports = function;

Is it possible to include the line no and filename in nestjs + typeorm when SQL error occurs?

If there is an SQL error occurs, the call stack only trace back to something like
at Query.Sequence._packetToError (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/Connection.js:91:28)
at Socket.<anonymous> (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/Connection.js:525:10)
at Socket.emit (events.js:203:13)
at Socket.EventEmitter.emit (domain.js:471:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
--------------------
at Protocol._enqueue (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at PoolConnection.query (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/Connection.js:201:25)
at MysqlQueryRunner.<anonymous> (/Applications/MAMP/htdocs/nestCms/src/driver/mysql/MysqlQueryRunner.ts:155:36)
at step (/Applications/MAMP/htdocs/nestCms/node_modules/tslib/tslib.js:133:27)
at Object.next (/Applications/MAMP/htdocs/nestCms/node_modules/tslib/tslib.js:114:57)
at fulfilled (/Applications/MAMP/htdocs/nestCms/node_modules/tslib/tslib.js:104:62)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
Any clue on how to quickly identify which line and file is actually sending the query from?

Resources