Closed DLYSY closed 9 months ago
I wished you had used a docker compose.
You can also log into the container:
docker exec -it lychee bash
and then
php artisan migrate
But I agree that we need to investigate this migration.
我也不秀自己那蹩脚的四级英语了,看不懂的自己想办法翻译吧
To encourage active collaboration, Lychee strongly encourages pull requests, not just bug reports.
Remember, bug reports are created in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the bug report will automatically see any activity or that others will jump in to fix it. Creating a bug report serves to help yourself and others start on the path to fixing the problem.
我承认这是良好的社区规则,但我本职和专业为大数据分析,不熟悉 SQL 和 PHP ,对于我无法自行解决我遇到的问题,我很抱歉。不过令我更加遗憾的是,看到社区对这个问题没有给予足够的重视。
自从v5.0.0
以来,虽然开发者们在短时间内积极跟新了数个小版本,但我依然遇到了非常多的问题,如Profile界面403等问题,虽然没有像这个问题一样严重,但总是无形之中影响正常使用。
现在因为此 issue 描述问题使我无法继续使用Lychee
的更高版本。眼看修复和解决无望,我将会将 Lychee
降级到最后可用的v5.0.3
迁移数据并停止使用Lychee
。
(From a Google translation, so some nuance may be lost)
Seeing that there is no hope of repair and resolution
I'm not sure how you get this from
we need to investigate this migration.
我也不秀自己那蹩脚的四级英语了,看不懂的自己想办法翻译吧
Google translate is doing a pretty good job. :)
我承认这是良好的社区规则,但我本职和专业为大数据分析,不熟悉 SQL 和 PHP ,对于我无法自行解决我遇到的问题,我很抱歉。不过令我更加遗憾的是,看到社区对这个问题没有给予足够的重视。
Yeah... Unfortunately, the Lychee community is very small as I am pretty much the only active developer on this project. My time is very limited:
I am dedicating all my free time left to Lychee (for which I am not paid). I see issues pilling up, I try to resolve them when I can, picking up the most urgent at first.
自从
v5.0.0
以来,虽然开发者们在短时间内积极跟新了数个小版本,但我依然遇到了非常多的问题,如Profile界面403等问题,虽然没有像这个问题一样严重,但总是无形之中影响正常使用。
We try to avoid issues as much as possible, but that takes time (which I don't necessarily have). The fact that we pushed that many small versions actually shows that we are actively fixing bugs, improving the stability of Lychee and listening to feedback.
现在因为此 issue 描述问题使我无法继续使用
Lychee
的更高版本。眼看修复和解决无望,我将会将Lychee
降级到最后可用的v5.0.3
迁移数据并停止使用Lychee
。
I don't know how you use Lychee, but if you are using docker compose (which I surely hope). Updating just requires you to:
latest
)docker compose down
docker compose pull
docker compose up -d
That is literally what I am doing to update my install. Docker compose up will trigger the entrypoint.sh
and make sure that you are running the latest version of the database (hence why I consider this issue as Low priority).
As as mentioned here , give us some time to investigate... Since version 5.1.1 we lost one of our dev. So yes our code throughput is very limited.
I don't know how you use Lychee, but if you are using docker compose (which I surely hope). Updating just requires you to:
- edit the compose to latest tag (or simply use
latest
)docker compose down
docker compose pull
docker compose up -d
That is literally what I am doing to update my install. Docker compose up will trigger the
entrypoint.sh
and make sure that you are running the latest version of the database (hence why I consider this issue as Low priority).As as mentioned here, give us some time to investigate... Since version 5.1.1 we lost one of our dev. So yes our code throughput is very limited.
Perhaps my initial description when submitting the issue wasn't accurate enough, I just mentioned:
- Run
docker run lycheeorg/lychee:v5.1.0
But actually, I omitted many parameters in between because I thought providing information such as database hostname and user parameters would be useless for troubleshooting. In my initial issue description, I also referenced the logs, where I saw database errors:
2024_01_13_124937_create_oauth_credentials_table ................ 140ms FAIL In Connection.php line 822: SQLSTATE[HY000]: General error: 3780 Referencing column 'user_id' and referenced column 'id' in foreign key constraint 'oauth_credentials_user_id_foreign' are incompatible. (Connection: mysql, SQL: alter table `oauth_credentials` add constraint `oauth_credentials_user_id_foreign` foreign key (`user_id`) references `users` (`id`) on delete cascade on update cascade) In Connection.php line 580: SQLSTATE[HY000]: General error: 3780 Referencing column 'user_id' and referenced column 'id' in foreign key constraint 'oauth_credentials_user_id_foreign' are incompatible.
This obviously isn't a problem that switching to Docker compose can solve. Indeed, Docker Compose can facilitate deployment more quickly, but as long as used properly, Docker CLI can achieve the same purpose completely. Here, I also provide the complete usage of my Docker CLI:
docker run -d \
--name=lychee \
--restart=always \
-v /srv/docker/lychee/conf:/conf \
-v /srv/docker/lychee/uploads:/uploads \
-v /srv/docker/lychee/sym:/sym \
-e DB_CONNECTION=mysql \
-e DB_HOST=mysql \
-e DB_PORT=3306 \
-e DB_DATABASE=lychee \
-e DB_USERNAME=lychee \
-e DB_PASSWORD=password \
-p 8081:80 \
--network mysqlbridge \
lycheeorg/lychee
The update theme of v5.1.0
is:
Version 5.1.0 - Oauth supported for major providers.
Which corresponds directly to the table oauth_credentials
, I don't think this is a coincidence.
You can also log into the container:
docker exec -it lychee bash
and then
php artisan migrate
But I agree that we need to investigate this migration.
I did try manual migration, but the error message was identical to what was presented in the log above.
Yeah... Unfortunately, the Lychee community is very small as I am pretty much the only active developer on this project. My time is very limited:
- I have a full-time job.
- I have a girlfriend (lucky me).
- I am a top-sport ballroom dancer (which means ~10h of training per week)
- I am a photographer (when I have the time)
I am dedicating all my free time left to Lychee (for which I am not paid). I see issues piling up, I try to resolve them when I can, picking up the most urgent at first.
Seeing no hope for fixing and solving, I will downgrade
lychee
to the last availablev5.0.3
, migrate the data, and stop usingLychee
.
I understand the dilemma of open-source community developers, and I am very grateful for selfless contributors like you, but considering that my image service based on Lychee
is almost unusable (it has been going on for about a month), I cannot rely on a long and unpredictable fix (especially when the issue is classified as low priority in the issue tracker). Temporarily disabling Lychee
is a necessary step.
I don't know how you use Lychee, but if you are using docker compose (which I surely hope). Updating just requires you to:
- edit the compose to latest tag (or simply use
latest
)docker compose down
docker compose pull
docker compose up -d
That is literally what I am doing to update my install. Docker compose up will trigger the
entrypoint.sh
and make sure that you are running the latest version of the database (hence why I consider this issue as Low priority).As as mentioned here , give us some time to investigate... Since version 5.1.1 we lost one of our dev. So yes our code throughput is very limited.
也许是在我最初提交 issue 时的表述不够准确,我仅仅说明我
- Run
docker run lycheeorg/lychee:v5.1.0
但其实我省略了中间很多的参数,因为我认为提供数据库主机名、用户等参数信息对解决问题是无用的。我在最初的issue说明中也引用了日志,我看到日志中说明了数据库错误:
2024_01_13_124937_create_oauth_credentials_table ................ 140ms FAIL In Connection.php line 822: SQLSTATE[HY000]: General error: 3780 Referencing column 'user_id' and refer enced column 'id' in foreign key constraint 'oauth_credentials_user_id_foreign' are incompatible. (Connection: mysql, SQL: alter table `oauth_credentials` add constraint `oauth_credentials_user_id_foreign` foreign key (`user_id`) references `users` (`id`) on delete cascade on update cascade) In Connection.php line 580: SQLSTATE[HY000]: General error: 3780 Referencing column 'user_id' and refer enced column 'id' in foreign key constraint 'oauth_credentials_user_id_foreign' are incompatible.
这显然不是改用docker conpose所能解决的问题。诚然,docker compose可以更快速的实现部署,但只要使用得当,docker cli也是完全可以实现相同目的的。我这里也给出我docker cli的完整用法:
docker run -d \
--name=lychee \
--restart=always \
-v /srv/docker/lychee/conf:/conf \
-v /srv/docker/lychee/uploads:/uploads \
-v /srv/docker/lychee/sym:/sym \
-e DB_CONNECTION=mysql \
-e DB_HOST=mysql \
-e DB_PORT=3306 \
-e DB_DATABASE=lychee \
-e DB_USERNAME=lychee \
-e DB_PASSWORD=password \
-p 8081:80 \
--network mysqlbridge \
lycheeorg/lychee
v5.1.0
的更新主题是
Version 5.1.0 - Oauth supported for major providers.
刚好对应表oauth_credentials
,我认为这并非巧合。
You can also log into the container:
docker exec -it lychee bash
and then
php artisan migrate
But I agree that we need to investigate this migration.
我并不是没有尝试手动迁移,但其报错信息与上文日志中呈现的别无二致。
Yeah... Unfortunately, the Lychee community is very small as I am pretty much the only active developer on this project. My time is very limited:
- I have a full time job.
- I have a girlfriend (lucky me).
- I am a top-sport ballroom dancer (which means ~10h of training per week)
- I am a photographer (when I have the time)
I am dedicating all my free time left to Lychee (for which I am not paid). I see issues pilling up, I try to resolve them when I can, picking up the most urgent at first.
眼看修复和解决无望,我将会将
lychee
降级到最后可用的v5.0.3
迁移数据并停止使用Lychee
。
我明白开源社区开发者的困境,也很感谢你这样的无私奉献者,但鉴于目前我基于Lychee
的图片服务处于几乎不可用的状态(大概已经持续了1个月),我不能寄希望于一个漫长且不可预测的修复(更何况还在issue被列为低优先级的情况下),暂时停用Lychee
实属无奈之举。
This sounds a lot like #2206, except you're past that version (possibly by starting at 5.0.3?) and you are setting DB_CONNECTION
so it can't be the same thing.
I guess it could be worth double checking that /conf/.env
in your container has the correct settings (especially DB_CONNECTION
) in case that issue has a wider scope than we thought.
This sounds a lot like #2206, except you're past that version (possibly by starting at 5.0.3?) and you are setting so it can't be the same thing.
DB_CONNECTION
I guess it could be worth double checking that in your container has the correct settings (especially ) in case that issue has a wider scope than we thought.
/conf/.env``DB_CONNECTION
I have read #2206 before I open this issue. Unfortunately it's helpless.
This is my /conf/.env
:
APP_NAME=...
APP_ENV=development
APP_KEY=...
APP_DEBUG=false
APP_URL=...
APP_FORCE_HTTPS=true
# enable or disable debug bar. By default it is disabled.
# Do note that this disable CSP!!
DEBUGBAR_ENABLED=false
# enable or disable log viewer. By default it is enabled.
LOG_VIEWER_ENABLED=true
##############################################################################
# IMPORTANT: To migrate from Lychee v3 you *MUST* use the same MySQL/MariaDB #
# server as v3. #
##############################################################################
# Table prefix (e.g. lychee_) of a Lychee v3 instance for migration
DB_OLD_LYCHEE_PREFIX=
# DB_CONNECTION can be sqlite, mysql or pgsql. For sqlite the other entries are
# not required, but an existing sqlite3 database may be specified if desired. In
# this case, please use an absolute path. DB_DATABASE may be omitted but should
# *not* be left blank.
DB_CONNECTION=mysql
DB_HOST=mysql
DB_DATABASE=lychee
DB_USERNAME=lychee
DB_PASSWORD=...
DB_LOG_SQL=false
# List foreign keys in diagnostic page
DB_LIST_FOREIGN_KEYS=true
# Application timezone. If not specified, the server's default timezone is used.
# Requires a named timezone identifier.
# See https://www.php.net/manual/en/timezones.php for the list of supported timezones.
# Don't use a timezone offset (like +01:00) or a timezone abbreviation (like CEST)
TIMEZONE=Asia/Shanghai
# Visibility of directories and (media) files in LYCHEE_UPLOADS
# Possible values are:
#
# - private: world group has neither read nor write access
# - public: world group has read access but no write access (the default)
# - world: world group has read and write access
#
# The default should suffice for most installations.
# For improved security, change this setting to "private".
# Some rare setups may require directories and files to be world writeable.
# In this case, use "world" here.
# USE WITH PRECAUTIONS: world writeable files and folders may be a SECURITY RISK.
# LYCHEE_IMAGE_VISIBILITY=public
# folders in which the files will be stored
# LYCHEE_UPLOADS="/var/www/html/Lychee-Laravel/public/uploads/"
# LYCHEE_DIST="/var/www/html/Lychee-Laravel/public/dist/"
# LYCHEE_SYM="/var/www/html/Lychee-Laravel/public/sym/"
# url to access those files
# LYCHEE_UPLOADS_URL="uploads/"
# LYCHEE_DIST_URL="dist/"
# LYCHEE_SYM_URL="sym/"
# Support for token based authentication used by API requests. Enabled by default.
# ENABLE_TOKEN_AUTH=true
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
# `sync` if jobs needs to be executed live (default) or `database` if they can be defered.
QUEUE_CONNECTION=sync
SECURITY_HEADER_HSTS_ENABLE=false
SESSION_SECURE_COOKIE=false
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_NAME=
MAIL_FROM_ADDRESS=
# The trusted proxies if Lychee is behind a reverse proxy
# Accepted values:
# - `null`: no proxy
# - `*`: any proxy
# - <ip address>[,<ip address>]: a comma-seperated list of IP addresses
TRUSTED_PROXIES=null
# Comma-separated list of class names of diagnostics checks that should be skipped.
#SKIP_DIAGNOSTICS_CHECKS=
I am closing this because the title is clearly a duplicate of #2206 which will be fixed shortly once #2286 is merged.
Detailed description of the problem
When using the docker image and mysql as a database, and upgrading to the version
5.1.0
, the migration fails with the errorBranch is not master
, I was upgrading from version5.0.3
. Downgrading to the old version5.0.3
works and the lychee page displays correctly. Looking at the attached logs, it seems like there are something wrong with database.Steps to reproduce the issue
Steps to reproduce the behavior:
docker stop lychee
lycheeorg/lychee:5.0.3
tolycheeorg/lychee:v5.1.0
docker run lycheeorg/lychee:v5.1.0
Migration result of Branch is not master
Screenshots
Output of the diagnostics
Browser and system
Browser is Microsoft Edge 121.0.2277.83 on Windows 10
Lychee is running in Docker on Alpine Linux
Workaround
Downgrading to
v5.0.3