runner
runner copied to clipboard
StdError [HttpError]: Response code 403 (Forbidden)
Everything has been working fine until recently getting this 403 response when trying to start mongodb-runner
- [email protected] (latest)
- node 12.9.1
- mac os x 10.15.3 (Catalina)
~ ❯ mongodb-runner start
◜ Starting a MongoDB deployment to test against...StdError [HTTPError]: Response code 403 (Forbidden)
at EventEmitter.<anonymous> (/usr/local/lib/node_modules/mongodb-runner/node_modules/got/index.js:250:24)
at EventEmitter.emit (events.js:209:13)
at Immediate.<anonymous> (/usr/local/lib/node_modules/mongodb-runner/node_modules/got/index.js:99:8)
at processImmediate (internal/timers.js:439:21) {
name: 'HTTPError',
host: 'fastdl.mongodb.org',
hostname: 'fastdl.mongodb.org',
method: 'GET',
path: '/osx/mongodb-macos-x86_64-4.2.4.tgz',
protocol: 'https:',
url: 'https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.4.tgz',
statusCode: 403,
statusMessage: 'Forbidden',
headers: {
'content-type': 'application/xml',
'transfer-encoding': 'chunked',
connection: 'close',
date: 'Sat, 14 Mar 2020 21:42:25 GMT',
server: 'AmazonS3',
'x-cache': 'Error from cloudfront',
via: '1.1 6a9b42e38e76b7d4a4044ebe0e0eca09.cloudfront.net (CloudFront)',
'x-amz-cf-pop': 'SEA19-C2',
'x-amz-cf-id': 'RS3OleoocqZ9Ltp6ZAmLHKUPKRiWbvC3tLdQuQYfXZyCXYky86MrMg=='
}
}
StdError [HTTPError]: Response code 403 (Forbidden)
at EventEmitter.<anonymous> (/usr/local/lib/node_modules/mongodb-runner/node_modules/got/index.js:250:24)
at EventEmitter.emit (events.js:209:13)
at Immediate.<anonymous> (/usr/local/lib/node_modules/mongodb-runner/node_modules/got/index.js:99:8)
at processImmediate (internal/timers.js:439:21) {
name: 'HTTPError',
host: 'fastdl.mongodb.org',
hostname: 'fastdl.mongodb.org',
method: 'GET',
path: '/osx/mongodb-macos-x86_64-4.2.4.tgz',
protocol: 'https:',
url: 'https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.4.tgz',
statusCode: 403,
statusMessage: 'Forbidden',
headers: {
'content-type': 'application/xml',
'transfer-encoding': 'chunked',
connection: 'close',
date: 'Sat, 14 Mar 2020 21:42:25 GMT',
server: 'AmazonS3',
'x-cache': 'Error from cloudfront',
via: '1.1 6a9b42e38e76b7d4a4044ebe0e0eca09.cloudfront.net (CloudFront)',
'x-amz-cf-pop': 'SEA19-C2',
'x-amz-cf-id': 'RS3OleoocqZ9Ltp6ZAmLHKUPKRiWbvC3tLdQuQYfXZyCXYky86MrMg=='
}
}
Temp workaround is setting MONGODB_VERSION=4.2.3
MongoDB download page (https://www.mongodb.com/download-center/community) shows latest release is 4.2.3 so not sure where 4.2.4 is coming from
This is also happening to other versions.
StdError [HTTPError]: Response code 403 (Forbidden)
at EventEmitter.<anonymous> (/home/vsonline/.npm-global/lib/node_modules/mongodb-runner/node_modules/got/index.js:250:24)
at EventEmitter.emit (events.js:210:5)
at Immediate.<anonymous> (/home/vsonline/.npm-global/lib/node_modules/mongodb-runner/node_modules/got/index.js:99:8)
at processImmediate (internal/timers.js:439:21) {
name: 'HTTPError',
host: 'fastdl.mongodb.org',
hostname: 'fastdl.mongodb.org',
method: 'GET',
path: '/linux/mongodb-linux-x86_64-4.2.8.tgz',
protocol: 'https:',
url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.2.8.tgz',
statusCode: 403,
statusMessage: 'Forbidden',
headers: {
'content-type': 'application/xml',
'transfer-encoding': 'chunked',
connection: 'close',
date: 'Tue, 30 Jun 2020 21:13:56 GMT',
server: 'AmazonS3',
'x-cache': 'Error from cloudfront',
via: '1.1 987c00b911316df568db602f83876a8e.cloudfront.net (CloudFront)',
'x-amz-cf-pop': 'DUS51-C1',
'x-amz-cf-id': 'G50IaYpMFB44EB_8_xljslGGC2qGf7gFeo2vQIY-heSPFb59gTUrCA=='
}
}
mongodb url changed:
new: https://fastdl.mongodb.org/src/mongodb-src-r4.2.8.tar.gz old: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.2.8.tgz << This is not working
mongodb url changed:
new: https://fastdl.mongodb.org/src/mongodb-src-r4.2.8.tar.gz old: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.2.8.tgz << This is not working
Could you please tell me how to modify the "old" link to the "new" link? Thank you so much.
I ended up hardcoding in the new URL at line 306
This seems to at least download the file, however now I get a new error
~: mongodb-runner start
◡ Starting a MongoDB deployment to test against...✔ Downloaded MongoDB 4.4.1
◞ Starting a MongoDB deployment to test against...internal/fs/utils.js:714
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (25320)
at writeFile (fs.js:1386:5)
at go$writeFile (/usr/lib/node_modules/mongodb-runner/node_modules/graceful-fs/graceful-fs.js:139:14)
at Object.writeFile (/usr/lib/node_modules/mongodb-runner/node_modules/graceful-fs/graceful-fs.js:136:12)
at Object.writeFile (/usr/lib/node_modules/mongodb-runner/node_modules/universalify/index.js:5:67)
at /usr/lib/node_modules/mongodb-runner/lib/index.js:240:12
at nextTask (/usr/lib/node_modules/mongodb-runner/node_modules/async/dist/async.js:4576:27)
at next (/usr/lib/node_modules/mongodb-runner/node_modules/async/dist/async.js:4584:13)
at /usr/lib/node_modules/mongodb-runner/node_modules/async/dist/async.js:321:20
at /usr/lib/node_modules/mongodb-runner/lib/index.js:235:11
at getPIDPath (/usr/lib/node_modules/mongodb-runner/lib/index.js:22:3) {
code: 'ERR_INVALID_ARG_TYPE'
}
So I do think this issue needs to be properly resolved
Running into this as well for 4.4.1.
I'm thinking this is the new URL: https://fastdl.mongodb.org/src/mongodb-src-r4.4.1.tar.gz
mongodb-runner start
◜ Starting a MongoDB deployment to test against...StdError [HTTPError]: Response code 403 (Forbidden)
at EventEmitter.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:250:24)
at EventEmitter.emit (events.js:314:20)
at Immediate.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:99:8)
at processImmediate (internal/timers.js:461:21) {
host: 'fastdl.mongodb.org',
hostname: 'fastdl.mongodb.org',
method: 'GET',
path: '/linux/mongodb-linux-x86_64-4.4.1.tgz',
protocol: 'https:',
url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.4.1.tgz',
statusCode: 403,
statusMessage: 'Forbidden',
headers: {
'content-type': 'application/xml',
'transfer-encoding': 'chunked',
connection: 'close',
date: 'Wed, 11 Nov 2020 06:16:27 GMT',
server: 'AmazonS3',
'x-cache': 'Error from cloudfront',
via: '1.1 91eda795c3265b7a81caba456f5e9dd8.cloudfront.net (CloudFront)',
'x-amz-cf-pop': 'SFO20-C1',
'x-amz-cf-id': 'cZipXkhHB4MVF9uX6jWtGPXDzIR_ocmwWMceE-Oo5LYEpMblB6u0Jg=='
}
}
StdError [HTTPError]: Response code 403 (Forbidden)
at EventEmitter.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:250:24)
at EventEmitter.emit (events.js:314:20)
at Immediate.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:99:8)
at processImmediate (internal/timers.js:461:21) {
host: 'fastdl.mongodb.org',
hostname: 'fastdl.mongodb.org',
method: 'GET',
path: '/linux/mongodb-linux-x86_64-4.4.1.tgz',
protocol: 'https:',
url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.4.1.tgz',
statusCode: 403,
statusMessage: 'Forbidden',
headers: {
'content-type': 'application/xml',
'transfer-encoding': 'chunked',
connection: 'close',
date: 'Wed, 11 Nov 2020 06:16:27 GMT',
server: 'AmazonS3',
'x-cache': 'Error from cloudfront',
via: '1.1 91eda795c3265b7a81caba456f5e9dd8.cloudfront.net (CloudFront)',
'x-amz-cf-pop': 'SFO20-C1',
'x-amz-cf-id': 'cZipXkhHB4MVF9uX6jWtGPXDzIR_ocmwWMceE-Oo5LYEpMblB6u0Jg=='
}
}
Hardcoding the URL I get the same error as @iommu
/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/mongodb-download-url/index.js - around line 305
@iommu URL fix may be working in and of itself, however, the subsequent error may be related to Node version, at least according to this issue: https://github.com/mongodb-js/runner/issues/177
I'm on v14.11.0
the following command is working for me
MONGODB_VERSION=4.0.15 npx mongodb-runner start
the following command is working for me
MONGODB_VERSION=4.0.15 npx mongodb-runner start
Unfortunately, that didn't work for me.
What version of Node are you running? node -v
I think I may have got it working; ~~I'm not 100% sure, as I've never used Parse and haven't tested any further than this, however.~~ "Saving your first object" worked and I'm running Parse Dashboard etc.
After hard coding the v4.4.1 URL, as mentioned above by @iommu and myself, in mongodb-runner/node_modules/mongodb-download-url/index.js, around line 305:
//opts.url = format('https://%s/%s/%s', hostname, opts.platform, artifact);
opts.url = "https://fastdl.mongodb.org/src/mongodb-src-r4.4.1.tar.gz";
You'll then need to edit mongodb-runner/lib/index.js
Line 235 or 236, change:
cb(null, pid, pidPath);
to:
cb(null, pid.toString(), pidPath);
Note: I'm running nvm, as such the above paths may be different for you. Find your own mongodb-runner/lib/index.js, where ever your mongodb-runner and its node_modules live.
This is the output:
❯ npx mongodb-runner start
◠ Starting a MongoDB deployment to test against...✔ Downloaded MongoDB 4.4.1
◞ Starting a MongoDB deployment to test against...%
❯ npm start
> parse@ start /home/username/Code/parse
> parse-server config.json
Configuration loaded from /home/username/Code/parse/config.json
allowClientClassCreation: true
appId: ***REDACTED***
appName: Parse
cacheMaxSize: 10000
cacheTTL: 5000
cloud: ./cloud/main
customPages: {}
databaseURI: mongodb://127.0.0.1:27017/parse
enableAnonymousUsers: true
expireInactiveSessions: true
graphQLPath: /graphql
host: 0.0.0.0
idempotencyOptions: {"ttl":300,"paths":[]}
logsFolder: ./logs
masterKey: ***REDACTED***
masterKeyIps: []
maxUploadSize: 20mb
mountPath: /parse
objectIdSize: 10
playgroundPath: /playground
port: 1337
protectedFields: {"_User":{"*":["email"]}}
revokeSessionOnPasswordReset: true
schemaCacheTTL: 5000
sessionLength: 31536000
allowCustomObjectId: false
collectionPrefix:
directAccess: false
enableExpressErrorHandler: false
enableSingleSchemaCache: false
mountGraphQL: false
mountPlayground: false
preserveFileName: false
preventLoginWithUnverifiedEmail: false
scheduledPush: false
verifyUserEmails: false
jsonLogs: false
verbose: false
level: undefined
serverURL: http://localhost:1337/parse
[140115] parse-server running on http://localhost:1337/parse
@Natetronn i am running node v10.19.0
i am running
node v10.19.0
Thanks, I figured as much. Yeah, this second issue that iommu and I were hitting is related to v14.x.x.
I believe my fix above addressed it.
Running into this as well for 4.4.1.
I'm thinking this is the new URL: https://fastdl.mongodb.org/src/mongodb-src-r4.4.1.tar.gz
mongodb-runner start ◜ Starting a MongoDB deployment to test against...StdError [HTTPError]: Response code 403 (Forbidden) at EventEmitter.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:250:24) at EventEmitter.emit (events.js:314:20) at Immediate.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:99:8) at processImmediate (internal/timers.js:461:21) { host: 'fastdl.mongodb.org', hostname: 'fastdl.mongodb.org', method: 'GET', path: '/linux/mongodb-linux-x86_64-4.4.1.tgz', protocol: 'https:', url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.4.1.tgz', statusCode: 403, statusMessage: 'Forbidden', headers: { 'content-type': 'application/xml', 'transfer-encoding': 'chunked', connection: 'close', date: 'Wed, 11 Nov 2020 06:16:27 GMT', server: 'AmazonS3', 'x-cache': 'Error from cloudfront', via: '1.1 91eda795c3265b7a81caba456f5e9dd8.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'SFO20-C1', 'x-amz-cf-id': 'cZipXkhHB4MVF9uX6jWtGPXDzIR_ocmwWMceE-Oo5LYEpMblB6u0Jg==' } } StdError [HTTPError]: Response code 403 (Forbidden) at EventEmitter.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:250:24) at EventEmitter.emit (events.js:314:20) at Immediate.<anonymous> (/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/got/index.js:99:8) at processImmediate (internal/timers.js:461:21) { host: 'fastdl.mongodb.org', hostname: 'fastdl.mongodb.org', method: 'GET', path: '/linux/mongodb-linux-x86_64-4.4.1.tgz', protocol: 'https:', url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.4.1.tgz', statusCode: 403, statusMessage: 'Forbidden', headers: { 'content-type': 'application/xml', 'transfer-encoding': 'chunked', connection: 'close', date: 'Wed, 11 Nov 2020 06:16:27 GMT', server: 'AmazonS3', 'x-cache': 'Error from cloudfront', via: '1.1 91eda795c3265b7a81caba456f5e9dd8.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'SFO20-C1', 'x-amz-cf-id': 'cZipXkhHB4MVF9uX6jWtGPXDzIR_ocmwWMceE-Oo5LYEpMblB6u0Jg==' } }Hardcoding the URL I get the same error as @iommu
/home/username/.nvm/versions/node/v14.11.0/lib/node_modules/mongodb-runner/node_modules/mongodb-download-url/index.js- around line 305
thanks man it helped a lot
I think I may have got it working; ~I'm not 100% sure, as I've never used Parse and haven't tested any further than this, however.~ "Saving your first object" worked and I'm running Parse Dashboard etc.
After hard coding the v4.4.1 URL, as mentioned above by @iommu and myself, in
mongodb-runner/node_modules/mongodb-download-url/index.js, around line 305://opts.url = format('https://%s/%s/%s', hostname, opts.platform, artifact); opts.url = "https://fastdl.mongodb.org/src/mongodb-src-r4.4.1.tar.gz";You'll then need to edit
mongodb-runner/lib/index.jsLine 235 or 236, change:
cb(null, pid, pidPath);to:cb(null, pid.toString(), pidPath);Note: I'm running nvm, as such the above paths may be different for you. Find your own
mongodb-runner/lib/index.js, where ever your mongodb-runner and its node_modules live.This is the output:
❯ npx mongodb-runner start ◠ Starting a MongoDB deployment to test against...✔ Downloaded MongoDB 4.4.1 ◞ Starting a MongoDB deployment to test against...% ❯ npm start > parse@ start /home/username/Code/parse > parse-server config.json Configuration loaded from /home/username/Code/parse/config.json allowClientClassCreation: true appId: ***REDACTED*** appName: Parse cacheMaxSize: 10000 cacheTTL: 5000 cloud: ./cloud/main customPages: {} databaseURI: mongodb://127.0.0.1:27017/parse enableAnonymousUsers: true expireInactiveSessions: true graphQLPath: /graphql host: 0.0.0.0 idempotencyOptions: {"ttl":300,"paths":[]} logsFolder: ./logs masterKey: ***REDACTED*** masterKeyIps: [] maxUploadSize: 20mb mountPath: /parse objectIdSize: 10 playgroundPath: /playground port: 1337 protectedFields: {"_User":{"*":["email"]}} revokeSessionOnPasswordReset: true schemaCacheTTL: 5000 sessionLength: 31536000 allowCustomObjectId: false collectionPrefix: directAccess: false enableExpressErrorHandler: false enableSingleSchemaCache: false mountGraphQL: false mountPlayground: false preserveFileName: false preventLoginWithUnverifiedEmail: false scheduledPush: false verifyUserEmails: false jsonLogs: false verbose: false level: undefined serverURL: http://localhost:1337/parse [140115] parse-server running on http://localhost:1337/parse
Thanks a lot! This saved me from a lot of more research