Skip to content

Parse Jobs are not firing #8875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
suathh opened this issue Jan 7, 2024 · 6 comments
Closed
4 tasks done

Parse Jobs are not firing #8875

suathh opened this issue Jan 7, 2024 · 6 comments
Labels
state:duplicate Duplicate of already reported issue type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@suathh
Copy link

suathh commented Jan 7, 2024

New Issue Checklist

Issue Description

When I try to start a job I get multiple failures.

Steps to reproduce

  1. Define a simple job (Logs "test" etc.)
  2. Try to run the job via /jobs/RankUsers and you will get "error": "unauthorized: master key is required" even masterKey is provided and masterKeyIPs: ['0.0.0.0/0', '::0'] added.
  3. Create a scheduler script to run the job
  4. Try to run the job via command line on your local by simply typing something like "node .\ranking.js"

Actual Outcome

For Step 2 I already explained
For step 4

TypeError: Cannot read properties of undefined (reading 'length') at Object.request (C:\Users\Suat\Documents\GitHub\kale-usta-backend\node_modules\parse\lib\node\RESTController.js:204:17) at Object.startJob (C:\Users\Suat\Documents\GitHub\kale-usta-backend\node_modules\parse\lib\node\Cloud.js:140:43) at Object.startJob (C:\Users\Suat\Documents\GitHub\kale-usta-backend\node_modules\parse\lib\node\Cloud.js:96:52) at Object.<anonymous> (C:\Users\Suat\Documents\GitHub\kale-usta-backend\jobs\ranking.js:9:13) at Module._compile (node:internal/modules/cjs/loader:1241:14) at Module._extensions..js (node:internal/modules/cjs/loader:1295:10) at Module.load (node:internal/modules/cjs/loader:1091:32) at Module._load (node:internal/modules/cjs/loader:938:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) at node:internal/main/run_main_module:23:47

I dig the root line for the error and it is Line 203 in RestController.js 

let url = _CoreManager.default.get('SERVER_URL');

My server URLs are defined

Expected Outcome

Job start success response

Environment

Tried on both Linux & Windows env.

"parse": "^4.3.1",
"parse-server": "^6.4.0",

Server

  • Parse Server version: 6.4.0
  • Operating system: Linux/Windows
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local/Heroku

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: ``
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local/Heroku

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JS SDK
  • SDK version: 4.3.1

Logs

Logs from the QA Server

Jan 07 01:40:40 kale-backend-qa heroku/scheduler.5855 Starting process with command node jobs/ranking.js
Jan 07 01:40:40 kale-backend-qa heroku/scheduler.5855 State changed from starting to up
Jan 07 01:40:41 kale-backend-qa heroku/scheduler.5855 State changed from up to complete
Jan 07 01:40:41 kale-backend-qa heroku/scheduler.5855 Process exited with status 0
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 ParseError: unauthorized
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 at handleError (/app/node_modules/parse/lib/node/RESTController.js:298:17)
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 at async Object.startJob (/app/node_modules/parse/lib/node/Cloud.js:140:22) {
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 code: undefined
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 }
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 ParseError: unauthorized
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 at handleError (/app/node_modules/parse/lib/node/RESTController.js:298:17)
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 at async Object.startJob (/app/node_modules/parse/lib/node/Cloud.js:140:22) {
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 code: undefined
Jan 07 01:40:41 kale-backend-qa app/scheduler.5855 }

Logs from DEV server when I try to start job by REST API

2024-01-07T09:38:36.971824+00:00 app[web.1]: Error: unauthorized: master key is required
2024-01-07T09:38:36.971825+00:00 app[web.1]: at promiseEnforceMasterKeyAccess (/app/node_modules/parse-server/lib/middlewares.js:430:19)
2024-01-07T09:38:36.971826+00:00 app[web.1]: at /app/node_modules/parse-server/lib/PromiseRouter.js:74:20
2024-01-07T09:38:36.971826+00:00 app[web.1]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-01-07T09:40:11.627556+00:00 app[api]: Starting process with command node jobs/mediacenter.js by user scheduler@addons.heroku.com
2024-01-07T09:40:21.941786+00:00 heroku[scheduler.1299]: Starting process with command node jobs/mediacenter.js
2024-01-07T09:40:22.522721+00:00 heroku[scheduler.1299]: State changed from starting to up
2024-01-07T09:40:23.285614+00:00 heroku[scheduler.1299]: Process exited with status 1
2024-01-07T09:40:23.202572+00:00 app[scheduler.1299]: /app/node_modules/parse/lib/node/RESTController.js:298
2024-01-07T09:40:23.202579+00:00 app[scheduler.1299]: error = new _ParseError.default(errorJSON.code, errorJSON.error);
2024-01-07T09:40:23.202579+00:00 app[scheduler.1299]: ^
2024-01-07T09:40:23.202580+00:00 app[scheduler.1299]:
2024-01-07T09:40:23.202580+00:00 app[scheduler.1299]: ParseError: unauthorized
2024-01-07T09:40:23.202581+00:00 app[scheduler.1299]: at handleError (/app/node_modules/parse/lib/node/RESTController.js:298:17)
2024-01-07T09:40:23.202581+00:00 app[scheduler.1299]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
2024-01-07T09:40:23.202581+00:00 app[scheduler.1299]: code: undefined
2024-01-07T09:40:23.202581+00:00 app[scheduler.1299]: }
2024-01-07T09:40:23.202581+00:00 app[scheduler.1299]:
2024-01-07T09:40:23.202582+00:00 app[scheduler.1299]: Node.js v20.10.0

Logs from Local when I try both Rest API or Trigger the Node script

TypeError: Cannot read properties of undefined (reading 'length')
at Object.request (C:\Users\Suat\Documents\GitHub\kale-usta-backend\node_modules\parse\lib\node\RESTController.js:204:17)
at Object.startJob (C:\Users\Suat\Documents\GitHub\kale-usta-backend\node_modules\parse\lib\node\Cloud.js:140:43)
at Object.startJob (C:\Users\Suat\Documents\GitHub\kale-usta-backend\node_modules\parse\lib\node\Cloud.js:96:52)
at Object. (C:\Users\Suat\Documents\GitHub\kale-usta-backend\jobs\ranking.js:9:13)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at node:internal/main/run_main_module:23:47

Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza
Copy link
Member

mtrezza commented Jan 7, 2024

Seems like a duplicate of #8872?

You mention this happens on "Linux/Windows", but the log shows only Windows; can you confirm this happens on Linux as well?

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed state:duplicate Duplicate of already reported issue labels Jan 7, 2024
@suathh
Copy link
Author

suathh commented Jan 7, 2024

Seems like a duplicate of #8872?

You mention this happens on "Linux/Windows", but the log shows only Windows; can you confirm this happens on Linux as well?

One part of it yes, but when you pass masterKey control it still logs the error I explained in the issue

Linux tested on Heroku, same result as windows

@suathh
Copy link
Author

suathh commented Jan 8, 2024

@mtrezza I have now more confidence and clues to consider this is a duplicate of #8872

@mtrezza
Copy link
Member

mtrezza commented Jan 13, 2024

In your description that you are using masterKeyIPs: ['0.0.0.0/0', '::0'] but to allow "any IPv6 address" it should be masterKeyIPs: ['0.0.0.0/0', '::/0']. Could you try that?

@mtrezza
Copy link
Member

mtrezza commented Jan 16, 2024

Closing as resolved, see discussion in #8872. If the issue still exists, please comment and we can re-open.

@mtrezza mtrezza closed this as completed Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:duplicate Duplicate of already reported issue type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants