Verba icon indicating copy to clipboard operation
Verba copied to clipboard

`CORS Missing Allow Origin` when deployed using docker

Open pktiuk opened this issue 1 year ago • 3 comments

Description

There is a problem with verba when I deploy it on another machine (not on my local machine.

When I want to open Verba UI I I get stuck on Welcome to Verba Choose your deployment view.

image

Installation

  • [ ] pip install goldenverba
  • [ ] pip install from source
  • [X] Docker installation

Weaviate Deployment

  • [ ] Local Deployment
  • [X] Docker Deployment
  • [ ] Cloud Deployment

Configuration

Reader: Chunker: Embedder: Retriever: Generator:

Steps to Reproduce

You need 2 machines in your network:

  • Your local dev machine with IP: 192.168.0.100
  • Your strong server with IP 192.168.0.200

Steps:

  1. Deploy verba using docker compose from this repo docker compose up -d --build on your server machine
  2. Open http://192.168.0.200:8000 on your dev machine
  3. Press Docker option
  4. App is stuck

Additional context

Possible workaround is using ssh tunnels to access Verba ssh -L 8001:localhost:8000 [email protected], then website works under http://localhost:8001 on dev machine

pktiuk avatar Dec 11 '24 14:12 pktiuk

Hey thanks for the issue! This is because of this @middleware section

https://github.com/weaviate/Verba/blob/30ae51ef66279fa2d001ccbfbc7f5659277c3467/goldenverba/server/api.py#L82

It checks if the requests have the same origin, since it's deployed on another machine it fails with the CORS error message. I'll think of a way to disable this, but for now the workaround would be to simply delete the whole custom middleware logic. Let me know if that works for you 🚀

thomashacker avatar Dec 11 '24 19:12 thomashacker

@thomashacker

Thank you for fix. It helped me.

pktiuk avatar Dec 18 '24 10:12 pktiuk

Hey thanks for the issue! This is because of this @middleware section

Verba/goldenverba/server/api.py

Line 82 in 30ae51e @app.middleware("http")

It checks if the requests have the same origin, since it's deployed on another machine it fails with the CORS error message. I'll think of a way to disable this, but for now the workaround would be to simply delete the whole custom middleware logic. Let me know if that works for you 🚀

Thanks. This also helped me!

jlar0che avatar May 12 '25 02:05 jlar0che