easychen / pushdeer

开放源码的无App推送服务,iOS14+扫码即用。亦支持快应用/iOS和Mac客户端、Android客户端、自制设备
Other
4.62k stars 469 forks source link

[error]pushdeer-main_app启动报错 #149

Closed developer-wlj closed 2 years ago

developer-wlj commented 2 years ago

修改数据库端口,app启动报错

环境 CentOS 7.9 docker 20.10.12

报的错误

Illuminate\Database\QueryException

SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema. tables where table_schema = pushdeer and table_name = migrations and table_type = 'BASE TABLE')

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:705 701▕ // If an exception occurs when attempting to run a query, we'll format the error 702▕ // message to include the bindings with SQL, which will make this exception a 703▕ // lot more helpful to the developer instead of just the database's errors. 704▕ catch (Exception $e) { ➜ 705▕ throw new QueryException( 706▕ $query, $this->prepareBindings($bindings), $e 707▕ ); 708▕ } 709▕ }

[2m+36 vendor frames  37 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

手动查看数据库information_schema.tables没有table_schema = pushdeer的数据 而且pushdeer库中也没有任何表

easychen commented 2 years ago

这应该是数据库容器初始化失败了,把现有容器删了重新安装试试。留意下数据库配置是否正确。

developer-wlj commented 2 years ago

摸索了一天 大概知道docker 的工作模式 参考docker 安装redis启发的解决思路 使用命令 docker network list image 可以发现有个pushdeer-main_default网络,可以理解成它下面的容器视为 在一个ip下 所以删除docker-compose.self-hosted.yml文件中的

easychen commented 2 years ago

所以这其实就是因为本地有3306端口导致数据库容器启动失败吧。删除对外暴露的端口的确比改端口更好,如果不用上的话。

developer-wlj commented 2 years ago

不是,初步排查到app容器中,php相关配置,是写死的,所以在yml中无论怎么设置都不起作用,我对php不熟悉,尝试修改database.php和env还是不行,才使用上面的方法

easychen commented 2 years ago

但是docker的环境变量会覆盖默认配置才对啊,一会儿我试试

---原始邮件--- 发件人: @.> 发送时间: 2022年9月16日(周五) 中午12:12 收件人: @.>; 抄送: @.**@.>; 主题: Re: [easychen/pushdeer] [error]pushdeer-main_app启动报错 (Issue #149)

不是,初步排查到app容器中,php相关配置,是写死的,所以在yml中无论怎么设置都不起作用,我对php不熟悉,尝试修改database.php和env还是不行,才使用上面的方法

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

developer-wlj commented 2 years ago

yml稍微改了下 目前最新配置 可以外部访问 version: '2.1' services: mariadb: image: 'mariadb:10.5.8-focal' healthcheck: test: ["CMD", "mysqladmin", "ping", "--silent","--password=$$MYSQL_ROOT_PASSWORD"] timeout: 10s retries: 3 volumes:

mirokymac commented 2 years ago

yml稍微改了下 目前最新配置 可以外部访问 version: '2.1' services: mariadb: image: 'mariadb:10.5.8-focal' healthcheck: test: ["CMD", "mysqladmin", "ping", "--silent","--password=$$MYSQL_ROOT_PASSWORD"] timeout: 10s retries: 3 volumes: - 'mariadb_data:/var/lib/mysql' environment: - MYSQL_ROOT_PASSWORD=theVeryp@ssw0rd - MYSQL_DATABASE=pushdeer ports: - '3307:3306' redis: image: 'bitnami/redis:6.0.16' healthcheck: test: ["CMD", "redis-cli","ping"] environment: - ALLOW_EMPTY_PASSWORD=yes app: #image: 'webdevops/php-apache:8.0-alpine' build: './docker/web/' ports: - '8800:80' volumes: - './:/app' depends_on: mariadb: condition: service_healthy redis: condition: service_healthy environment: - GO_PUSH_IOS_TOPIC=com.pushdeer.self.ios - GO_PUSH_IOS_CLIP_TOPIC=com.pushdeer.self.ios.Clip - APP_DEBUG=false - MQTT_API_KEY=9LKo3 - MQTT_ON=false mqtt: image: 'ccr.ccs.tencentyun.com/ftqq/pushdeeresp' ports: - '1883:1883' environment: - API_KEY=9LKo3 - MQTT_PORT=1883 - MQTT_USER=easy - MQTT_PASSWORD=y0urp@ss - MQTT_BASE_TOPIC=default volumes: mariadb_data:

我也遇到了改端口的问题。 按照您的方案修改后app能启动了,但是使用IOS自建版链接的时候出现internal error 500,无法使用。