[SOLVED]ReplyError: ERR DB index is out of range when hosting server on Railway

Getting the following error message when hosting v1 server on Railway. The server works completely fine locally and deploys fine on Railway but starts getting this within minutes.

npm WARN config production Use `--omit=dev` instead.
> [email protected] start
> node build/index.js
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
warn: DeprecationWarning: The Parse Server option 'directAccess' default will change to 'true' in a future version. Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one.
warn: DeprecationWarning: The Parse Server option 'enforcePrivateUsers' default will change to 'true' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
info: Parse LiveQuery Server started running
WARNING, Unable to connect to 'https://plausible-truck-production.up.railway.app/server';. Cloud code and push notifications may be unavailable!
/app/node_modules/parse-server/lib/ParseServer.js:261
throw err;
^
ReplyError: ERR DB index is out of range
at parseError (/app/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/app/node_modules/redis-parser/lib/parser.js:302:14)
Emitted 'error' event on RedisClient instance at:
at Object.callbackOrEmit [as callback_or_emit] (/app/node_modules/redis/lib/utils.js:91:14)
at RedisClient.return_error (/app/node_modules/redis/index.js:642:11)
at JavascriptRedisParser.returnError (/app/node_modules/redis/index.js:142:18)
at JavascriptRedisParser.execute (/app/node_modules/redis-parser/lib/parser.js:542:14)
at Socket.<anonymous> (/app/node_modules/redis/index.js:219:27)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
command: 'SELECT',
args: [ '27' ],
code: 'ERR'

https://plausible-truck-production.up.railway.app/

This is the correct domain assigned to your Railway project? You also shouldn’t be getting the Unable to connect error, make sure you have updated your SERVER_URL environment variable:

SERVER_URL=https://***.up.railway.app/server

Can you show your environment variables (Variables tab > Raw Editor)? You can hide any secrets (Moralis API key, MongoDB, Redis string) but keep the format e.g. redis://user:password@***.redislabs.com:port

Sure, so these are the environment variables:

MORALIS_API_KEY=bGOtumbO3VPbMnycXeB*****KtKuz4sxvjxd9UQ6hWRfFQvBpuDaBIxOl1OF8Qle
PORT=1337
MASTER_KEY=9*****
APPLICATION_ID=001
SERVER_URL=https://plausible-truck-production.up.railway.app/server
CLOUD_PATH=./build/cloud/main.js
DATABASE_URI=mongodb+srv://user:[email protected]/parse?retryWrites=true&w=majority
REDIS_CONNECTION_STRING=redis://user:[email protected]:10612'
RATE_LIMIT_TTL=30
RATE_LIMIT_AUTHENTICATED=50
RATE_LIMIT_ANONYMOUS=20
USE_STREAMS=true
STREAMS_WEBHOOK_URL=/streams-webhook

maybe this helps:

1 Like

Remove the comma at the end here if that was in there - it should redeploy again after you save it.

1 Like