ps -AF
сервиса нет× system_wb.service - WB_API
Loaded: loaded (/etc/systemd/system/system_wb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2024-07-13 17:06:05 UTC; 7min ago
Process: 1062 ExecStart=/usr/bin/python3 /home/wb_api/WB_API_D01/main.py (code=exited, status=1/FAILURE)
Main PID: 1062 (code=exited, status=1/FAILURE)
CPU: 241ms
Jul 13 17:06:05 wb-test-python systemd[1]: system_wb.service: Scheduled restart job, restart counter is at 5.
Jul 13 17:06:05 wb-test-python systemd[1]: Stopped WB_API.
Jul 13 17:06:05 wb-test-python systemd[1]: system_wb.service: Start request repeated too quickly.
Jul 13 17:06:05 wb-test-python systemd[1]: system_wb.service: Failed with result 'exit-code'.
Jul 13 17:06:05 wb-test-python systemd[1]: Failed to start WB_API.
Jul 13 17:06:05 wb-test-python systemd[1]: system_wb.service: Start request repeated too quickly.
Jul 13 17:06:05 wb-test-python systemd[1]: system_wb.service: Failed with result 'exit-code'.
Jul 13 17:06:05 wb-test-python systemd[1]: Failed to start WB_API.
sudo journalctl -xe -u
, хотя бы ошибки видно.config = dotenv_values(".env") # config = {}
api_wb = config.get("URL_Method_Statistic")
Jul 13 18:11:09 wb-test-api python3[3511]: File "/home/WB_API_D01/main.py", line 64, in update_sales_schedule
Jul 13 18:11:09 wb-test-api python3[3511]: update_sales_orders(url=url_stat,
Jul 13 18:11:09 wb-test-api python3[3511]: File "/home/WB_API_D01/update_order_sales_wb_dg_gs.py", line 69, in update_sales_orders
Jul 13 18:11:09 wb-test-api python3[3511]: response = orders_sales_get_wb(url=url, token=api_key_1, endpoint=endpoint, date_from=date_download_data_wb.date())
Jul 13 18:11:09 wb-test-api python3[3511]: File "/home/WB_API_D01/script_wb.py", line 19, in orders_sales_get_wb
Jul 13 18:11:09 wb-test-api python3[3511]: response = wildberries_api_get(key=token, api_wb=url, endpoint=endpoint, params=params)
Jul 13 18:11:09 wb-test-api python3[3511]: File "/home/WB_API_D01/api_wb.py", line 21, in wildberries_api_get
Jul 13 18:11:09 wb-test-api python3[3511]: response = requests.get(api_wb + endpoint, headers=headers, params=params)
Jul 13 18:11:09 wb-test-api python3[3511]: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
sudo journalctl -xe -u
, не знал про эту команду, спасла неимоверно за счет наличия информации об ошибке) rafox@wb-test-python:/home/wb_api/WB_API_D01$ systemctl status system_wb.service
● system_wb.service - WB_API
Loaded: loaded (/etc/systemd/system/system_wb.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2024-07-13 14:47:03 UTC; 22min ago
Main PID: 1519 (python3)
Tasks: 1 (limit: 1010)
Memory: 20.8M
CPU: 317ms
CGroup: /system.slice/system_wb.service
└─1519 /usr/bin/python3 /home/wb_api/WB_API_D01/main.py
Jul 13 14:26:40 wb-test-python systemd[1]: Stopped WB_API.
░░ Subject: A stop job for unit system_wb.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A stop job for unit system_wb.service has finished.
░░
░░ The job identifier is 2526 and the job result is done.
Jul 13 14:26:40 wb-test-python systemd[1]: system_wb.service: Start request repeated too quickly.
Jul 13 14:26:40 wb-test-python systemd[1]: system_wb.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit system_wb.service has entered the 'failed' state with result 'exit-code'.
Jul 13 14:26:40 wb-test-python systemd[1]: Failed to start WB_API.
░░ Subject: A start job for unit system_wb.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit system_wb.service has finished with a failure.
░░
░░ The job identifier is 2526 and the job result is failed.
Jul 13 14:47:03 wb-test-python systemd[1]: Started WB_API.
░░ Subject: A start job for unit system_wb.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit system_wb.service has finished successfully.
░░
░░ The job identifier is 2758.
Jul 13 15:10:51 wb-test-python systemd[1]: Stopping WB_API...
░░ Subject: A stop job for unit system_wb.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A stop job for unit system_wb.service has begun execution.
░░
░░ The job identifier is 3439.
Jul 13 15:10:51 wb-test-python systemd[1]: system_wb.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit system_wb.service has successfully entered the 'dead' state.
Jul 13 15:10:51 wb-test-python systemd[1]: Stopped WB_API.
░░ Subject: A stop job for unit system_wb.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A stop job for unit system_wb.service has finished.
░░
░░ The job identifier is 3439 and the job result is done.
-- Boot 4e3c7ccde73440cd8244179bfcd4df4e --
Jul 13 15:11:51 wb-test-python systemd[1]: Started WB_API.
░░ Subject: A start job for unit system_wb.service has finished successfully
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit system_wb.service has finished successfully.
░░
░░ The job identifier is 171.
from pyrogram import Client, types, raw
from settings import *
from _datetime import datetime
app = Client(name=name_uset_admin, api_id=api_id, api_hash=api_hash)
async def main(image, date, button):
async with app:
await app.send_photo(channel, photo=image, caption="Set Total", schedule_date=date, reply_markup=button)
date = datetime(year=2022, month=6, day=17, hour=00, minute=9)
image = "url image"
app.run(main(image, date))
Traceback (most recent call last):
File "D:\Python\Code\test1\telegramBot.py", line 26, in <module>
temp = int(temp)
NameError: name 'temp' is not defined
temp = int(temp)
tempMin = int(tempMin)
tempMax = int(tempMax)
WindSpeed = int(WindSpeed)
if (temp >= 2 and temp <= 4) or (temp >= 22 and temp <= 24) or (temp >= 32 and temp <= 34) or (temp >= 42 and temp <= 44):
textGradus = " градуса"
elif (temp >= 5 and temp <= 20) or (temp >= 25 and temp <= 30) or (temp == 0) or (temp >= 35 and temp <= 40) or (temp >= 45 and temp <= 50):
textGradus = " градусов"
elif temp == 21 or temp == 31 or temp == 41 or temp == 51:
textGradus = " градус"
elif (temp <= -2 and temp >= -4) or (temp <= -22 and temp >= -24) or (temp <= -32 and temp >= -34) or (temp <= -42 and temp >= -44):
textGradus = " градуса"
elif (temp <= -5 and temp >= -20) or (temp <= -25 and temp >= -30) or (temp <= -35 and temp >= -40) or (temp <= -45 and temp >= -50):
textGradus = " градусов"
elif temp == -21 or temp == -31 or temp == -41 or temp == -51:
textGradus = " градус"
if (tempMin >= 2 and tempMin <= 4) or (tempMin >= 22 and tempMin <= 24) or (tempMin >= 32 and tempMin <= 34) or (tempMin >= 42 and tempMin <= 44):
textGradusMin = " градуса"
elif (tempMin >= 5 and tempMin <= 20) or (tempMin >= 25 and tempMin <= 30) or (tempMin == 0) or (tempMin >= 35 and tempMin <= 40) or (tempMin >= 45 and tempMin <= 50):
textGradusMin = " градусов"
elif tempMin == 21 or tempMin == 31 or tempMin == 41 or tempMin == 51:
textGradusMin = " градус"
elif (tempMin <= -2 and tempMin >= -4) or (tempMin <= -22 and tempMin >= -24) or (tempMin <= -32 and tempMin >= -34) or (tempMin <= -42 and tempMin >= -44):
textGradusMin = " градуса"
elif (tempMin <= -5 and tempMin >= -20) or (tempMin <= -25 and tempMin >= -30) or (tempMin <= -35 and tempMin >= -40) or (tempMin <= -45 and tempMin >= -50):
textGradusMin = " градусов"
elif tempMin == -21 or tempMin == -31 or tempMin == -41 or tempMin == -51:
textGradusMin = " градус"
if (tempMax >= 2 and tempMax <= 4) or (tempMax >= 22 and tempMax <= 24) or (tempMax >= 32 and tempMax <= 34) or (tempMax >= 42 and tempMax <= 44):
textGradusMax = " градуса"
elif (tempMax >= 5 and tempMax <= 20) or (tempMax >= 25 and tempMax <= 30) or (tempMax == 0) or (tempMax >= 35 and tempMax <= 40) or (tempMax >= 45 and tempMax <= 50):
textGradusMax = " градусов"
elif tempMax == 21 or tempMax == 31 or tempMax == 41 or tempMax == 51:
textGradusMax = " градус"
elif (tempMax <= -2 and tempMax >= -4) or (tempMax <= -22 and tempMax >= -24) or (tempMax <= -32 and tempMax >= -34) or (tempMax <= -42 and tempMax >= -44):
textGradusMax = " градуса"
elif (tempMax <= -5 and tempMax >= -20) or (tempMax <= -25 and tempMax >= -30) or (tempMax <= -35 and tempMax >= -40) or (tempMax <= -45 and tempMax >= -50):
textGradusMax = " градусов"
elif tempMax == -21 or tempMax == -31 or tempMax == -41 or tempMax == -51:
textGradusMax = " градус"