TeleGPT icon indicating copy to clipboard operation
TeleGPT copied to clipboard

Stuck at the compiling process when I use the cargo build --release

Open elliclee opened this issue 1 year ago • 6 comments

After the cargo build --release, everything seemed ok until the teloxide-core

root@ubuntu-s-1gb-sgp1-tg:~/TeleGPT# cargo build --release
   Compiling teloxide-core v0.6.3
    Building [=====================>   ] 227/253: teloxide-core  

It seems the crate 'teloxide-core v0.6.3' could not be found in registry index.

elliclee avatar Mar 23 '23 06:03 elliclee

after re-clone the repo and run the cargo build --release, stuck at the teloxide-core again

 Compiling takecell v0.1.1
   Compiling teloxide-core v0.9.1
    Building [====================>    ] 217/250: teloxide-core  

elliclee avatar Mar 23 '23 11:03 elliclee

@unixzii @Lakr233 Could You guys help me fix this problem~

elliclee avatar Mar 23 '23 13:03 elliclee

@elliclee What's your host machine and toolchain environment? Seems like it has nothing to do with the code.

unixzii avatar Mar 23 '23 13:03 unixzii

@unixzii I deploy the project on the server of Digitalocean(Ubuntu 22.10 x64)

elliclee avatar Mar 23 '23 14:03 elliclee

@unixzii after deploy to another server, I've built the telegpt, after running the telegpt, I got

lighthouse@VM-0-6-ubuntu:~$ ~/TeleGPT/target/release/telegpt
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: unable to open database file: /telegpt/data/telegpt.sqlite

Caused by:
    Error code 14: Unable to open the database file', /home/lighthouse/TeleGPT/src/app.rs:53:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

and my telegpt.config.json file is:


{
"openaiAPIKey": "sk-7yxxx",
"botToken": "6xxx4:Axxxs:",
"conversationLimit": 16,
"databasePath": "/telegpt/data/telegpt.sqlite",
"adminUsernames": [
"cyandev",
"withExtendedLifetime"
],
"i18n": {
"resetPrompt": "Your conversation has been reset."
}
}

elliclee avatar Mar 23 '23 16:03 elliclee

Hi @elliclee, I guess you were compiling the bot manually, and the config file you used is for Docker. The database path should be writable, for what you specified (/telegpt/data/telegpt.sqlite), please check if /telegpt/data/ directory exists.

unixzii avatar Mar 23 '23 17:03 unixzii