Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
166.1k stars 43.97k forks source link

Failed to connect to Redis #3476

Closed Xerizaf closed 1 year ago

Xerizaf commented 1 year ago

⚠️ Search for existing issues first ⚠️

Which Operating System are you using?

Windows

Which version of Auto-GPT are you using?

Latest Release

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

Connect to Redis

Current behavior 😯

FAILED TO CONNECT TO REDIS Error 99 connecting to localhost:6379. Cannot assign requested address. DOUBLE CHECK CONFIGURATION Please ensure you have setup and configured Redis properly for use. You can check out https://github.com/Torantulino/Auto-GPT#redis-setup to ensure you've set up everything correctly.

Expected behavior 🤔

To connect properly

Your prompt 📝

# Paste your prompt here

Your Logs 📒

<insert your logs here>
zweite commented 1 year ago
version: "3.9"
services:
  auto-gpt:
    depends_on:
      - redis
    build: ./
    env_file:
      - .env
    environment:
      MEMORY_BACKEND: ${MEMORY_BACKEND:-redis}
      REDIS_HOST: redis
    volumes:
      - ./:/app
    profiles: ["exclude-from-up"]
    links:
      - redis
  redis:
    image: "redis/redis-stack-server:latest"
    restart: always
    ports:
      - '6379:6379'
Xerizaf commented 1 year ago

Didn't solve the problem. How to create a redis password?

bobisme commented 1 year ago

by default redis has no password

Joshfindit commented 1 year ago

There are two paths here:

  1. Use redis without a password. This is the default. To do this remove or comment out any "REDIS_PASSWORD" entries in docker-compose.yml or .env
  2. Use redis with a password. Note: you cannot (currently) configure redis password simply as an environment variable. Here's a related issue: https://github.com/docker-library/redis/issues/176
Joshfindit commented 1 year ago

Apologies. I missed this one:

localhost:6379

For docker you have to set REDIS_HOST=redis

jameshutchins commented 1 year ago

Xerizaf, I had the same error after switching to a paid openai account. I generated a new api key at https://platform.openai.com/account/api-keys and copied it in to .env and that fixed it for me. Hopefully, this helps.

Xerizaf commented 1 year ago

Solved.

ryanniccolls commented 1 year ago

Where do I put this?

ryanniccolls commented 1 year ago

I got redi working on apple silicon mac with Autogpt by using Visual basic studio IDE and Docker Desktop. There is some juggling between apps. basically go through the autogpt readme file after downloading everything. which will prompt a dev container extension and redis environent.

  1. install "docker desktop", don't run yet (this will run the wrapper for redis and autogpt)
  2. install "visual basic code" app, don't run (use this will run the autogpt folder as a "a deve container"
  3. download autogpt folder
  4. use the readme inside autogpt
  5. copy and edit the necessary .env.template to .env
  6. remove the hashtags from the following lines of code. then save. ... MEMORY_BACKEND=redis ... REDIS_HOST=redis REDIS_PORT=6379 REDIS_PASSWORD= WIPE_REDIS_ON_START=False MEMORY_INDEX=auto-gpt"