lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
41.44k stars 9.39k forks source link

[Bug] 本地部署数据库版本时出现 Invalid environment variables: { S3_PUBLIC_DOMAIN: [ 'Invalid url' ] } #4112

Open aiiibolo opened 2 hours ago

aiiibolo commented 2 hours ago

📦 Environment

Vercel

📌 Version

v1.19.25

💻 Operating System

macOS

🌐 Browser

Other

🐛 Bug Description

本地部署数据库版本是部署失败 提示环境变量有错误 我检查了多次没有发现问题在哪。 以下是相关截图附件

CleanShot 2024-09-24 at 22 20 01@2x CleanShot 2024-09-24 at 22 20 27@2x CleanShot 2024-09-24 at 22 21 00@2x

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

lobehubbot commented 2 hours ago

👀 @aiiibolo

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

dosubot[bot] commented 2 hours ago

Hey there, @aiiibolo! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

To resolve the "Invalid environment variables: { S3_PUBLIC_DOMAIN: [ 'Invalid url' ] }" error when deploying a database version locally on Vercel with Next.js and tRPC, ensure that the S3_PUBLIC_DOMAIN environment variable is set to a valid URL. The URL must start with https:// to be considered valid.

Here is an example of how to set the S3_PUBLIC_DOMAIN environment variable correctly:

S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com

Make sure to replace https://s3-for-lobechat.your-domain.com with your actual S3 public domain URL. The https:// prefix is essential for the URL to be valid.

Additionally, note that NEXT_PUBLIC_S3_DOMAIN is deprecated and should be replaced with S3_PUBLIC_DOMAIN in your environment configuration. The src/config/file.ts file indicates that S3_PUBLIC_DOMAIN is the preferred variable:

const S3_PUBLIC_DOMAIN = process.env.S3_PUBLIC_DOMAIN || process.env.NEXT_PUBLIC_S3_DOMAIN;

if (!!process.env.NEXT_PUBLIC_S3_DOMAIN) {
  console.warn(
    '⚠️ `NEXT_PUBLIC_S3_DOMAIN` will be deprecated in the next major version, please replace it with `S3_PUBLIC_DOMAIN` in your env',
  );
}

Ensure that your environment variables are updated accordingly to avoid future issues [1][2].

Additionally, there are similar discussions that might be helpful:

  1. [RFC] 055 - 服务端数据库版部署环境变量优化 [3]
  2. Vercel部署报错出现这种状况改如何解决 [4]

To continue talking to Dosu, mention @dosu.

dosubot[bot] commented 2 hours ago

I found a similar discussion that might be relevant to your issue: Vercel部署报错出现这种状况改如何解决 [1].

To resolve the "Invalid environment variables: { S3_PUBLIC_DOMAIN: [ 'Invalid url' ] }" error, ensure that the S3_PUBLIC_DOMAIN environment variable is a valid URL. The URL must start with https://.

Here is an example of how to set the S3_PUBLIC_DOMAIN environment variable correctly:

S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com

Make sure to replace https://s3-for-lobechat.your-domain.com with your actual S3 public domain URL [2].

Additionally, there is a known issue related to version v1.19.25 of lobe-chat that could affect deployment. The issue is related to missing translations, which has been addressed in a recent bug fix [3].

If you continue to experience issues, please double-check your DNS records and ensure they are correctly configured.

To continue talking to Dosu, mention @dosu.