QuivrHQ / quivr

Open-source RAG Framework for building GenAI Second Brains 🧠 Build productivity assistant (RAG) ⚡️🤖 Chat with your docs (PDF, CSV, ...) & apps using Langchain, GPT 3.5 / 4 turbo, Private, Anthropic, VertexAI, Ollama, LLMs, Groq that you can share with users ! Efficient retrieval augmented generation framework
https://quivr.com
Other
36.16k stars 3.51k forks source link

[Bug]: supabase start fails with 502 error #2691

Open chtanch opened 3 months ago

chtanch commented 3 months ago

What happened?

I am trying to set up Quivr to run locally with ollama. The .env file is updated with a fake OPENAI_API_KEY and OLLAMA_API_BASE_URL.

After running supabase start, I get an Error Status 502.

I am running behind a corporate firewall. The environment variables http_proxy and https_proxy have been set, and docker daemon+client have been configured to use the proxies.

Relevant log output

Skipping migration local_20240107152745_ollama.sql... (file name must match pattern "<timestamp>_name.sql")
                                                                                                           Applying migration 20240103173626_init.sql...
Applying migration 20240103175048_prod.sql...
                                             Applying migration 20240103181249_premium.sql...
                                                                                             Applying migration 20240103181925_cleanup.sql...
Applying migration 20240103193921_stripe_customers.sql...
                                                         Applying migration 20240103194255_api.sql...
                                                                                                     Applying migration 20240103204741_product_to_features.sql...
                                                                                                                                                                 Applying migration 20240103231656_product.sql...
                            Applying migration 20240103234423_models.sql...
                                                                           Applying migration 20240107231636_policies.sql...
                                                                                                                            Applying migration 20240119070124_search.sql...
                                                                                                                                                                           Applying migration 20240119222036_metadata.sql...
                                       Applying migration 20240120004107_tags.sql...
                                                                                    Applying migration 20240121195523_fix-public.sql...
                                                                                                                                       Applying migration 20240122194117_monthly-credit.sql...
         Applying migration 20240125230346_raw.sql...
Applying migration 20240206040636_notion.sql...
                                               Applying migration 20240207034043_related.sql...
                                                                                               Applying migration 20240207071108_chunk.sql...
                                                                                                                                             Applying migration 20240216192826_integration.sql...
            Applying migration 20240228182948_notion.sql...
                                                           Applying migration 20240304223646_integrations-all.sql...
Applying migration 20240305225452_tags-integration.sql...
                                                         Applying migration 20240306013910_allow_model_change.sql...
                                                                                                                    Applying migration 20240306205133_integration_display_name.sql...
                                                                                                                                                                                   AApplying migration 20240313024244_onboarding-user.sql...
                                                       Applying migration 20240314005817_user_identity_company_info.sql...
                                                                                                                          Applying migration 20240316195514_usage_purpose.sql...
                                                                                                                                                                                Applying migration 20240318024425_rename_feedback_to_thumbs.sql...
                                                             Applying migration 20240320215813_fix_match_vector_function.sql...
                                                                                                                               Applying migration 20240329212126_onboarding_brain.sql...
   Applying migration 20240330233534_ingestion.sql...
                                                     Applying migration 20240402005455_ingestion.sql...
                                                                                                       Applying migration 20240402013303_ingestion_url.sql...
                                                                                                                                                             Applying migration 20240402015128_seed-ingestions.sql...
                                Applying migration 20240410112108_assistant.sql...
                                                                                  Applying migration 20240501180719_notifications.sql...
Applying migration 20240506150059_timestampz.sql...
                                                   Applying migration 20240514080520_rls_optim.sql...
                                                                                                     Applying migration 20240516143634_syncs.sql...
                                                                                                                                                   Applying migration 20240521144817_syncs-files.sql...
                  Applying migration 20240529132812_syncs-emails.sql...
                                                                       Applying migration 20240606170930_sync-reduce-time.sql...
                                                                                                                                Applying migration 20240608095352_supported-sync.sql...
  Applying migration 20240610141546_force-sync.sql...
                                                     Seeding data supabase/seed.sql...
supabase_edge_runtime_secondbrain container logs:
                                                 Download https://deno.land/std/http/status.ts
                                                                                              Download https://deno.land/x/jose@v4.13.1/index.ts
                                                                                                                                                Stopping containers...
Error status 502:
Try rerunning the command with --debug to troubleshoot the error.

Twitter / LinkedIn details

No response

chtanch commented 3 months ago

On running supabase start --debug

Error log (only the last parts, since the whole log is very long)

2024/06/19 23:36:14 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:14 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:14 Send Done
                                                                                                                                                                   2024/06/19 23:36:14 Recv First Byte
2024/06/19 23:36:15 Sent Header: Host [127.0.0.1:54321]
                                                       2024/06/19 23:36:15 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:15 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:15 Send Done
                                                                                                                                                                   2024/06/19 23:36:15 Recv First Byte
2024/06/19 23:36:16 Sent Header: Host [127.0.0.1:54321]
                                                       2024/06/19 23:36:16 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:16 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:16 Send Done
                                                                                                                                                                   2024/06/19 23:36:16 Recv First Byte
2024/06/19 23:36:17 Sent Header: Host [127.0.0.1:54321]
                                                       2024/06/19 23:36:17 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:17 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:17 Send Done
                                                                                                                                                                   2024/06/19 23:36:17 Recv First Byte
2024/06/19 23:36:18 Sent Header: Host [127.0.0.1:54321]
                                                       2024/06/19 23:36:18 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:18 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:18 Send Done
                                                                                                                                                                   2024/06/19 23:36:18 Recv First Byte
2024/06/19 23:36:19 Sent Header: Host [127.0.0.1:54321]
                                                       2024/06/19 23:36:19 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:19 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:19 Send Done
                                                                                                                                                                   2024/06/19 23:36:19 Recv First Byte
2024/06/19 23:36:20 Sent Header: Host [127.0.0.1:54321]
                                                       2024/06/19 23:36:20 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:20 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:20 Send Done
                                                                                                                                                                   2024/06/19 23:36:20 Recv First Byte
2024/06/19 23:36:21 Sent Header: Host [127.0.0.1:54321]
                                                       2024/06/19 23:36:21 Sent Header: User-Agent [Go-http-client/1.1]
                                                                                                                       2024/06/19 23:36:21 Sent Header: Apikey [eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0]
                                                                                                                                      2024/06/19 23:36:21 Send Done
                                                                                                                                                                   2024/06/19 23:36:21 Recv First Byte
                  supabase_edge_runtime_secondbrain container logs:
                                                                   DEBUG Opening cache /root/.cache/deno/dep_analysis_cache_v1...
                                                                                                                                 DEBUG Opening cache /root/.cache/deno/node_analysis_cache_v1...
            DEBUG FileFetcher::fetch() - specifier: file:///home/deno/index.ts
                                                                              DEBUG FileFetcher::fetch() - specifier: https://deno.land/std/http/status.ts
                                                                                                                                                          DEBUG FileFetcher::fetch_remote() - specifier: https://deno.land/std/http/status.ts
                                                         DEBUG FileFetcher::fetch_cached - specifier: https://deno.land/std/http/status.ts
                                                                                                                                          Download https://deno.land/std/http/status.ts
   DEBUG starting new connection: https://deno.land/
                                                    DEBUG FileFetcher::fetch() - specifier: https://deno.land/x/jose@v4.13.1/index.ts
                                                                                                                                     DEBUG FileFetcher::fetch_remote() - specifier: https://deno.land/x/jose@v4.13.1/index.ts
                                         DEBUG FileFetcher::fetch_cached - specifier: https://deno.land/x/jose@v4.13.1/index.ts
                                                                                                                               Download https://deno.land/x/jose@v4.13.1/index.ts
                                                                                                                                                                                 DEBUG starting new connection: https://deno.land/
Stopping containers...
Pruned containers: [34616962f4e6539a602da042c8cbf79679eb90e4533fd49943123c8695266d57 de64e846806decf3cf64ca1871fc25728227cf6c5c49ef5e0b3d14d683dc7395 29a37ad83bf6f249b52d42f852c4e4e75372661ec56951edec9f8191a4ac5378 572a8f1233d982f78e6263f09ea730abad2179ba2754648f9c63350793debd3b 9a8c5b7d420a4a45996792709cc0dc93c43caed9946182af80955ac5b6313cb5 1d5ee6490905f80bcd8335d56b8f02bd75b698bf1e24e6db33a0decde44bc0ee e93df671b0eed00e9412fbe6a5c961d0a7ee8a5a31faaeb9535a2e16aff68837 e2398a996747bc56ab75b3359cd08ac8f7fc8b1b5dacec2b0faf47bb825f6b0b c129cd6fb979e610d91d1d40072b11a0b99be0b40da83c700f8eb71fd8e46075 a3a5717e70457df5d6a02c88fc76e3a0c1da504ba889de8c1796adf32c2b029f]
Pruned volumes: [supabase_db_secondbrain supabase_config_secondbrain supabase_inbucket_secondbrain supabase_storage_secondbrain supabase_edge_runtime_secondbrain]
Pruned network: [supabase_network_secondbrain]
Error status 502:
dosubot[bot] commented 3 months ago

Hey @chtanch! I'm here to help you with any issues or questions you have. I'm a bot that can assist with bug fixes, answer questions, and guide you to become a contributor. Let me know how I can assist you!

The 502 Bad Gateway error you're encountering when running supabase start behind a corporate firewall is likely due to network configuration issues, particularly with the proxy settings. Here are some steps to troubleshoot and resolve this issue:

  1. Verify Proxy Settings: Ensure that the http_proxy and https_proxy environment variables are correctly set. You can check this by running:

    echo $http_proxy
    echo $https_proxy
  2. Docker Proxy Configuration: Make sure Docker is configured to use the proxy settings. You can configure Docker to use a proxy by creating or editing the Docker daemon configuration file (/etc/systemd/system/docker.service.d/http-proxy.conf for systemd-based systems):

    [Service]
    Environment="HTTP_PROXY=http://proxy.example.com:80/"
    Environment="HTTPS_PROXY=https://proxy.example.com:443/"
    Environment="NO_PROXY=localhost,127.0.0.1"

    After making changes, restart Docker:

    sudo systemctl daemon-reload
    sudo systemctl restart docker
  3. Supabase CLI Proxy Configuration: Ensure that the Supabase CLI is aware of the proxy settings. You can set the proxy environment variables before running the Supabase commands:

    export http_proxy=http://proxy.example.com:80/
    export https_proxy=https://proxy.example.com:443/
    supabase start
  4. Network Configuration: Check if there are any network restrictions or firewall rules that might be blocking the necessary ports for Supabase. Ensure that the following ports are open:

    • 54321 (PostgreSQL)
    • 54322 (Kong)
    • 54323 (Studio)
    • 54324 (Realtime)
    • 54325 (Storage)
    • 54326 (Edge Functions)
  5. Debugging: Run the Supabase start command with the --debug flag to get more detailed logs:

    supabase start --debug

    Analyze the debug logs to identify any specific network-related errors.

If the issue persists, you might need to consult your network administrator to ensure that all necessary traffic is allowed through the corporate firewall.

To continue talking to Dosu, mention @dosu.

chtanch commented 3 months ago

I have checked all the solution steps, and they do not solve my problem

fxgeoffrey commented 2 weeks ago

I have the same issue too.