4x99 / code6

码小六 - GitHub 代码泄露监控系统
GNU General Public License v3.0
1.13k stars 201 forks source link

源码部署,登录时响应500是怎么回事呢 #180

Closed zhongjiao01 closed 2 years ago

yoonper commented 2 years ago

麻烦提供 storage/logs 下的报错信息

zhongjiao01 commented 2 years ago

[2022-02-11 14:18:02] production.ERROR: Class 'PDO' not found {"exception":"[object] (Error(code: 0): Class 'PDO' not found at /var/www/html /code6/vendor/laravel/framework/src/Illuminate/Database/Connection.php:1289) [stacktrace]

0 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(270): Illuminate\Database\Connect

ion::getResolver()

1 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(76): Illuminate\Database\Connecto

rs\ConnectionFactory->createConnection()

2 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(50): Illuminate\Database\Connecto

rs\ConnectionFactory->createSingleConnection()

3 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(131): Illuminate\Database\Connectors\Connecti

onFactory->make()

4 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(86): Illuminate\Database\DatabaseManager->make

Connection()

5 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1342): Illuminate\Database\DatabaseManager->con

nection()

6 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1308): Illuminate\Database\Eloquent\Model::res

olveConnection()

7 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1114): Illuminate\Database\Eloquent\Model->get

Connection()

8 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1031): Illuminate\Database\Eloquent\Model->new

BaseQueryBuilder()

9 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1067): Illuminate\Database\Eloquent\Model->new

ModelQuery()

10 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1020): Illuminate\Database\Eloquent\Model->ne

wQueryWithoutScopes()

11 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1728): Illuminate\Database\Eloquent\Model->ne

wQuery()

12 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1740): Illuminate\Database\Eloquent\Model->__

call()

13 /var/www/html/code6/app/Models/ConfigCommon.php(21): Illuminate\Database\Eloquent\Model::__callStatic()

14 /var/www/html/code6/app/Services/GitHubService.php(39): App\Models\ConfigCommon::getValue()

15 /var/www/html/code6/app/Console/Commands/JobRunCommand.php(111): App\Services\GitHubService->__construct()

16 /var/www/html/code6/app/Console/Commands/JobRunCommand.php(82): App\Console\Commands\JobRunCommand->createGitHubService()

17 [internal function]: App\Console\Commands\JobRunCommand->handle()

18 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(33): call_user_func_array()

19 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\Container\BoundMethod::Illuminate\Cont

ainer\{closure}()

20 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(91): Illuminate\Container\Util::unwrapIfClosure(

)

21 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBound

Method()

22 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Container/Container.php(592): Illuminate\Container\BoundMethod::call()

23 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call()

24 /var/www/html/code6/vendor/symfony/console/Command/Command.php(258): Illuminate\Console\Command->execute()

25 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run

()

26 /var/www/html/code6/vendor/symfony/console/Application.php(911): Illuminate\Console\Command->run()

27 /var/www/html/code6/vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand()

28 /var/www/html/code6/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun()

29 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()

30 /var/www/html/code6/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()

31 /var/www/html/code6/artisan(37): Illuminate\Foundation\Console\Kernel->handle()

32 {main}

"}

yoonper commented 2 years ago

PHP 没有安装 PDO 扩展

zhongjiao01 commented 2 years ago

大佬帮忙看看报这个日志啥意思 [stacktrace]

0 /var/www/html/vendor/symfony/console/Application.php(228): Symfony\Component\Console\Application->find()

1 /var/www/html/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun()

2 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()

3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()

4 /var/www/html/artisan(37): Illuminate\Foundation\Console\Kernel->handle()

5 {main}

"}

yoonper commented 2 years ago

做了什么操作报错,能提供完整一点的日志吗

zhongjiao01 commented 2 years ago

其实还是源码部署code6,上次说没有php拓展pdo,我重新安装了php和相关拓展,然后出现页面访问直接500的情况,其它日志没什么内容 [2022-02-14 15:43:11] production.ERROR: SQLSTATE[HY000] [1049] Unknown database 'code6' (SQL: select from information_schema.tables where table_schema = code6 and table_name = migrations and table_type = 'BA SE TABLE') {"exception":"[object] (Illuminate\Database\QueryException(code: 1049): SQLSTATE[HY000] [1049] Unknown database 'code6' (SQL: select from information_schema.tables where table_schema = code6 and table_name = migrations and table_type = 'BASE TABLE') at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671) [stacktrace]

0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback()

1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(339): Illuminate\Database\Connection->run()

2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(18): Illuminate\Database\Connection->select()

3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(169): Illuminate\Database\Schema\MySqlBuilder->hasTable()

4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(608): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists()

5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(93): Illuminate\Database\Migrations\Migrator->repositoryExists()

6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(64): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase()

7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(541): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}()

8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(81): Illuminate\Database\Migrations\Migrator->usingConnection()

9 [internal function]: Illuminate\Database\Console\Migrations\MigrateCommand->handle()

10 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(33): call_user_func_array()

11 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

12 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(91): Illuminate\Container\Util::unwrapIfClosure()

13 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()

14 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(592): Illuminate\Container\BoundMethod::call()

15 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call()

16 /var/www/html/vendor/symfony/console/Command/Command.php(258): Illuminate\Console\Command->execute()

17 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()

18 /var/www/html/vendor/symfony/console/Application.php(911): Illuminate\Console\Command->run()

19 /var/www/html/vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand()

20 /var/www/html/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun()

21 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()

22 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()

23 /var/www/html/artisan(37): Illuminate\Foundation\Console\Kernel->handle()

24 {main}

[previous exception] [object] (PDOException(code: 1049): SQLSTATE[HY000] [1049] Unknown database 'code6' at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70) [stacktrace]

0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(70): PDO->__construct()

1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()

2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()

3 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(182): Illuminate\Database\Connectors\MySqlConnector->connect()

4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()

5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(926): call_user_func()

6 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(961): Illuminate\Database\Connection->getPdo()

7 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(405): Illuminate\Database\Connection->getReadPdo()

8 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(331): Illuminate\Database\Connection->getPdoForSelect()

9 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}()

10 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback()

11 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php(339): Illuminate\Database\Connection->run()

12 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(18): Illuminate\Database\Connection->select()

13 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(169): Illuminate\Database\Schema\MySqlBuilder->hasTable()

14 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(608): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists()

15 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(93): Illuminate\Database\Migrations\Migrator->repositoryExists()

16 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(64): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase()

17 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(541): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}(

)

18 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(81): Illuminate\Database\Migrations\Migrator->usingConnection()

19 [internal function]: Illuminate\Database\Console\Migrations\MigrateCommand->handle()

20 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(33): call_user_func_array()

21 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

22 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(91): Illuminate\Container\Util::unwrapIfClosure()

23 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()

24 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(592): Illuminate\Container\BoundMethod::call()

25 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call()

26 /var/www/html/vendor/symfony/console/Command/Command.php(258): Illuminate\Console\Command->execute()

27 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()

28 /var/www/html/vendor/symfony/console/Application.php(911): Illuminate\Console\Command->run()

29 /var/www/html/vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand()

30 /var/www/html/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun()

31 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()

32 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()

33 /var/www/html/artisan(37): Illuminate\Foundation\Console\Kernel->handle()

34 {main}

"} [2022-02-14 15:45:03] production.ERROR: Command "code6:user-addd" is not defined.

Did you mean one of these? code6:job-add code6:job-run code6:notify code6:user-add code6:user-delete code6:user-list {"exception":"[object] (Symfony\Component\Console\Exception\CommandNotFoundException(code: 0): Command \"code6:user-addd\" is not defined.

Did you mean one of these? code6:job-add code6:job-run code6:notify code6:user-add code6:user-delete code6:user-list at /var/www/html/vendor/symfony/console/Application.php:644) [stacktrace]

0 /var/www/html/vendor/symfony/console/Application.php(228): Symfony\Component\Console\Application->find()

1 /var/www/html/vendor/symfony/console/Application.php(140): Symfony\Component\Console\Application->doRun()

2 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()

3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()

4 /var/www/html/artisan(37): Illuminate\Foundation\Console\Kernel->handle()

5 {main}

"}

yoonper commented 2 years ago

自动创建数据表的时候由于没有 PDO 扩展,执行失败 现在执行 php artisan migrate 导入数据表看下

zhongjiao01 commented 2 years ago

数据表,和用户已经都弄完了 [root@bogon html]# php artisan migrate


Migration table created successfully. Migrating: 2020_03_19_065140_create_config_token_table Migrated: 2020_03_19_065140_create_config_token_table (0.03 seconds) Migrating: 2020_03_19_070047_create_config_job_table Migrated: 2020_03_19_070047_create_config_job_table (0.01 seconds) Migrating: 2020_03_19_071658_create_config_whitelist_table Migrated: 2020_03_19_071658_create_config_whitelist_table (0.02 seconds) Migrating: 2020_03_19_072251_create_queue_job_table Migrated: 2020_03_19_072251_create_queue_job_table (0.01 seconds) Migrating: 2020_03_19_073207_create_code_leak_table Migrated: 2020_03_19_073207_create_code_leak_table (0.02 seconds) Migrating: 2020_03_19_080321_create_code_fragment_table Migrated: 2020_03_19_080321_create_code_fragment_table (0.01 seconds) Migrating: 2020_04_29_170507_create_user_table Migrated: 2020_04_29_170507_create_user_table (0.02 seconds) Migrating: 2020_06_13_143710_add_store_type_to_config_job_table Migrated: 2020_06_13_143710_add_store_type_to_config_job_table (0.02 seconds) Migrating: 2020_06_13_150004_add_index_repo_owner_and_repo_name_to_code_leak_table Migrated: 2020_06_13_150004_add_index_repo_owner_and_repo_name_to_code_leak_table (0.01 seconds) Migrating: 2020_07_03_091934_change_status_to_config_token_table Migrated: 2020_07_03_091934_change_status_to_config_token_table (0 seconds) Migrating: 2020_07_14_150603_create_config_notify_table Migrated: 2020_07_14_150603_create_config_notify_table (0.02 seconds) Migrating: 2021_05_08_104925_create_config_whitelist_file_table Migrated: 2021_05_08_104925_create_config_whitelist_file_table (0.01 seconds) Migrating: 2021_06_01_111745_create_config_common_table Migrated: 2021_06_01_111745_create_config_common_table (0.04 seconds)

yoonper commented 2 years ago

正常了吗

zhongjiao01 commented 2 years ago

不正常还是报500,异常之前就已经创建相应的表了

yoonper commented 2 years ago

你把日志清空了,再访问,然后提供新的日志 你贴的日志好像跟 500 错误无关

zhongjiao01 commented 2 years ago

我访问的500错误,没有产生新的日志

yoonper commented 2 years ago

源码根目录

vim .env
APP_ENV=local
APP_DEBUG=true

然后看下页面有无错误提示,是否生成错误日志

zhongjiao01 commented 2 years ago

没有看到生成新的错误日志, -rwxr-xr-x 1 apache apache 290868 2月 13 23:27 code6-2022-02-11.log -rw-r--r-- 1 root root 1 2月 14 00:03 code6-2022-02-14.log -rwxr-xr-x 1 apache apache 14887 2月 13 23:27 job-add-2022-02-11.log -rwxr-xr-x 1 apache apache 10388 2月 13 23:27 job-run-2022-02-11.log -rwxr-xr-x 1 apache apache 8986 2月 13 23:27 notify-2022-02-11.log

yoonper commented 2 years ago

页面上没有任何报错吗

zhongjiao01 commented 2 years ago

页面报以下错误 该网页无法正常运作 192.168.209.129 目前无法处理此请求。 HTTP ERROR 500

yoonper commented 2 years ago

我 QQ 加你看下吧,你留个联系方式

zhongjiao01 commented 2 years ago

2431241480,谢谢大佬