danny-avila / LibreChat

Enhanced ChatGPT Clone: Features Anthropic, OpenAI, Assistants API, Azure, Groq, GPT-4o, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, langchain, DALL-E-3, ChatGPT Plugins, OpenAI Functions, Secure Multi-User System, Presets, completely open-source for self-hosting. Actively in public development.
https://librechat.ai/
MIT License
17.2k stars 2.87k forks source link

[Bug]: LibreChat: TypeError [ERR_INVALID_ARG_TYPE] #650

Closed cyclecycle closed 1 year ago

cyclecycle commented 1 year ago

Contact Details

No response

What happened?

Receiving error on initial docker compose up. Expected no error

Steps to Reproduce

Clone latest main branch

Run docker compose up

See log output

What browsers are you seeing the problem on?

No response

Relevant log output

LibreChat         | > LibreChat@0.5.4 backend
LibreChat         | > cross-env NODE_ENV=production node api/server/index.js
LibreChat         | 
LibreChat         | 
LibreChat         | Clearing sync timeouts before exiting...
LibreChat         | node:buffer:330
LibreChat         |   throw new ERR_INVALID_ARG_TYPE(
LibreChat         |   ^
LibreChat         | 
LibreChat         | TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
LibreChat         |     at new NodeError (node:internal/errors:399:5)
LibreChat         |     at Function.from (node:buffer:330:9)
LibreChat         |     at Object.<anonymous> (/app/api/utils/crypto.js:2:20)
LibreChat         |     at Module._compile (node:internal/modules/cjs/loader:1275:14)
LibreChat         |     at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
LibreChat         |     at Module.load (node:internal/modules/cjs/loader:1133:32)
LibreChat         |     at Module._load (node:internal/modules/cjs/loader:972:12)
LibreChat         |     at Module.require (node:internal/modules/cjs/loader:1157:19)
LibreChat         |     at require (node:internal/modules/helpers:119:18)
LibreChat         |     at Object.<anonymous> (/app/api/utils/index.js:2:21) {
LibreChat         |   code: 'ERR_INVALID_ARG_TYPE'
LibreChat         | }
LibreChat         | 
LibreChat         | Node.js v19.9.0
LibreChat         | 
LibreChat exited with code 1

Screenshots

image

Code of Conduct

danny-avila commented 1 year ago

This is actually expected, but I should add a more meaningful error message.

Is this set in your .env file?

# For securely storing credentials, you need a fixed key and IV. You can set them here for prod and dev environments
# If you don't set them, the app will crash on startup.
# You need a 32-byte key (64 characters in hex) and 16-byte IV (32 characters in hex)
# Use this replit to generate some quickly: https://replit.com/@daavila/crypto#index.js
# Here are some examples (THESE ARE NOT SECURE!)
CREDS_KEY=f34be427ebb29de8d88c107a71546019685ed8b241d8f2ed00c3df97ad2566f0
CREDS_IV=e2341419ec3dd3d19b13a1a87fafcbfb