error log is not updated

I can 't see the error logs for the last two days.

I see "An error occurred. Please try again." but there is no error log.

why does everyone works fine on my local machine but keeps breaking when i upload onto pythonanywhere? even though I install all libraries?

In Tasks enter image description here code:

# This script restarts a Python program named

echo "Restarting bot..."

pid=$(ps -ef | grep "" | grep -v grep | awk '{print $2}')

if [ -z "$pid" ]; then
    echo "Bot is not running"
    echo "Bot has been terminated"
    kill -15 "$pid"
    sleep 5
    if ps -p "$pid" > /dev/null; then
        echo "Bot could not be terminated, forcing kill"
        kill -9 "$pid"

echo "Starting bot..."
nohup python3 ./src/ >/dev/null 2>&1 &
if [ "$?" -ne 0 ]; then
    echo "Failed to start bot"
    echo "Bot has been restarted successfully"

I see in the logs that the script runs without errors and outputs a message that the bot has been started, but the bot doesn't actually start running and when I check the console, I don't see it in the processes. Only after I manually run the same script from the console, the bot starts working. What am I doing wrong?

If you want a script to run all the time, you should use our always-on task feature. Our scheduled tasks are intended to run code on schedule -- if a process started by a scheduled task would reach 2h running time (on free account), it will be killed. Our consoles are designed for housekeeping tasks, nor for long-running jobs, too.

Regarding your Bash script (not a Bash expert, but here's my understaing of what happened): because you're putting python3 ./src/ in the background and redirecting all output to /dev/null you don't see any errors, if there are any; $? holds the exit code of the last command to finish, which is not necessarily the exit code of python3 ./src/ If you'd like to get exit code of that command, you should rather keep its pid by adding pid=$! after you run the command, then wait $pid -- now $? should show the exit code of the command.