lingdu1234 / axum_admin

axum admin rust vue
https://314.iu1314.top/
238 stars 45 forks source link

cargo run运行异常 #7

Closed zrz4066 closed 2 years ago

zrz4066 commented 2 years ago

编译都ok,但是cargo run后,打印信息后程序退出

axum_admin> cargo run Finished dev [unoptimized + debuginfo] target(s) in 0.65s Running target\debug\axum-admin.exe

                                       | |         (_)
 _ __   ___   ___ _ __ ___     __ _  __| |_ __ ___  _ _ __
| '_ \ / _ \ / _ \ '_ ` _ \   / _` |/ _` | '_ ` _ \| | '_ \
| |_) | (_) |  __/ | | | | | | (_| | (_| | | | | | | | | | |
| .__/ \___/ \___|_| |_| |_|  \__,_|\__,_|_| |_| |_|_|_| |_|
| |
|_|

。。。。。 at app\src\utils\api_utils.rs:42 on ThreadId(1)

78 2022-10-13T16:36:18.3031433+08:00 DEBUG sea_orm::driver::sqlx_sqlite: SELECT "sys_job"."job_id", "sys_job"."task_id", "sys_job"."task_count", "sys_job"."run_count", "sys_job"."job_name", "sys_job"."job_params", "sys_job"."job_group", "sys_job"."invoke_target", "sys_job"."cron_expression", "sys_job"."misfire_policy", "sys_job"."concurrent", "sys_job"."status", "sys_job"."create_by", "sys_job"."update_by", "sys_job"."remark", "sys_job"."last_time", "sys_job"."next_time", "sys_job"."end_time", "sys_job"."created_at", "sys_job"."updated_at", "sys_job"."deleted_at" FROM "sys_job" WHERE "sys_job"."status" = '1' ORDER BY "sys_job"."job_id" ASC at d:\RUST_HOME.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\sea-orm-0.9.2\src\driver\sqlx_sqlite.rs:131 on ThreadId(1)

:87 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace error: process didn't exit successfully: target\debug\axum-admin.exe (exit code: 101)

run error.txt

lingdu1234 commented 2 years ago

sea-orm-cli migrate fresh

重新迁移数据库即可

zrz4066 commented 2 years ago

执行sea-orm-cli migrate fresh,后使用cargo run,还是同样的错误 ( sea-orm-cli migrate down ,然后 sea-orm-cli migrate up ,sea-orm-cli migrate fresh,也是相同的结果)

2022-10-17T22:04:58.8634855+08:00 DEBUG sea_orm::driver::sqlx_sqlite: SELECT "sys_job"."job_id", "sys_job"."task_id", "sys_job"."task_count", "sys_job"."run_count", "sys_job"."job_name", "sys_job"."job_params", "sys_job"."job_group", "sys_job"."invoke_target", "sys_job"."cron_expression", "sys_job"."misfire_policy", "sys_job"."concurrent", "sys_job"."status", "sys_job"."create_by", "sys_job"."update_by", "sys_job"."remark", "sys_job"."last_time", "sys_job"."next_time", "sys_job"."end_time", "sys_job"."created_at", "sys_job"."updated_at", "sys_job"."deleted_at" FROM "sys_job" WHERE "sys_job"."status" = '1' ORDER BY "sys_job"."job_id" ASC at d:\RUST_HOME.cargo\registry\src\mirrors.ustc.edu.cn-61ef6e0cd06fb9b8\sea-orm-0.9.2\src\driver\sqlx_sqlite.rs:131 on ThreadId(1)

error: process didn't exit successfully: target\debug\axum-admin.exe (exit code: 101)

image

zrz4066 commented 2 years ago

sea-orm-cli migrate fresh

重新迁移数据库即可

还是出现一样的问题,使用mysql数据库也出现相同的报错。

zrz4066 commented 2 years ago

好像是这一行代码引起的,但是报错Win系统并没有出来。后面在bin/src/main.rs中添加打印信息,才报这一行异常。 let config =RustlsConfig::from_pem_file(&CFG.cert.cert, &CFG.cert.key).await.unwrap();

zrz4066 commented 2 years ago

已经顺利运行