ERROR: failed to solve: process "/bin/sh -c curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python" did not complete successfully: exit code: 1
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '10fb8fe047be'
down_revision: Union[str, None] = '99af779c8e34'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
2024/05/01 17:00:26 [notice] 2858#2858: using inherited sockets from "6;7;"
2024/05/01 17:04:58 [error] 3015#3015: *1 open() "/home/ubuntu/portfolio-server/static/portfolio/custom.css" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/custom.css HTTP/1.1", host: "77.243.80.21", referrer: "http://77.243.80.21/">
2024/05/01 17:04:58 [error] 3015#3015: *3 open() "/home/ubuntu/portfolio-server/static/portfolio/roo1ts.jpg" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/roo1ts.jpg HTTP/1.1", hos>
2024/05/01 17:04:59 [error] 3015#3015: *3 open() "/home/ubuntu/portfolio-server/static/portfolio/custom.css" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/custom.css HTTP/1.1", hos>
2024/05/01 17:04:59 [error] 3015#3015: *8 open() "/home/ubuntu/portfolio-server/static/portfolio/roo1ts.jpg" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/roo1ts.jpg HTTP/1.1", hos>
2024/05/01 17:05:00 [error] 3015#3015: *3 open() "/home/ubuntu/portfolio-server/static/portfolio/roo1ts.jpg" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/roo1ts.jpg HTTP/1.1", hos>
2024/05/01 17:05:00 [error] 3015#3015: *8 open() "/home/ubuntu/portfolio-server/static/portfolio/custom.css" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/custom.css HTTP/1.1", hos>
2024/05/01 17:05:00 [error] 3015#3015: *3 open() "/home/ubuntu/portfolio-server/static/portfolio/custom.css" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/custom.css HTTP/1.1", hos>
2024/05/01 17:05:00 [error] 3015#3015: *8 open() "/home/ubuntu/portfolio-server/static/portfolio/roo1ts.jpg" failed (13: Permission denied), client: 185.113.37.112, server: 77.243.80.21, request: "GET /static/portfolio/roo1ts.jpg HTTP/1.1", hos>
@dp.message_handler(filters.Text(startswith=['Продолжить выполнение', 'Попробовать еще раз']))
async def info_start_tasks(message: types.Message, next_stage=None, delay=None, task=None):
try:
user = get_object_or_404(User, telegram_id=message.chat.id)
if user.life_counter < 1:
raise TimeoutError
funnel = Funnel.objects.get(members=user)
if user.funnel_step == funnel.stage_id.count():
raise ValueError
if next_stage!=None:
# task.cancel()
print('NEXT STAGE:', next_stage)
stages = list(funnel.stage_id.all())
stage = Stage.objects.filter(stage_id=next_stage).first()
index_of_next_stage = stages.index(stage)
print('INDEX', index_of_next_stage)
user.funnel_step = index_of_next_stage
user.save()
else:
print('CHEEEECK344', user.funnel_step, funnel.stage_id.all())
stage = list(funnel.stage_id.all())[user.funnel_step]
statistics, _ = StageUser.objects.get_or_create(user=user, stage=stage)
if stage.time_to_finish != 0:
# logger.debug(f'запускаю таймер на {stage.time_to_finish * 3600} сек')
if user.cache_delete:
original_datetime = datetime.strptime(str(datetime.now()), "%Y-%m-%d %H:%M:%S.%f")
user.start_time_point = original_datetime.strftime("%Y-%m-%dT%H:%M:%S")
user.cache_delete = False
user.save()
current_datetime = datetime.now(datetime.UTC)
statistics.time_to_starting_burn = datetime.now()
statistics.save()
data_to_1_burn = current_datetime + timedelta(hours=stage.time_to_finish * 0.5)
data_to_2_burn = data_to_1_burn + timedelta(hours=stage.time_to_finish * 0.25)
data_to_3_burn = data_to_2_burn + timedelta(hours=stage.time_to_finish * 0.25)
task = check_stage_timeout_task.apply_async(
args=[statistics.id, [data_to_1_burn, data_to_2_burn, data_to_3_burn]],
eta=data_to_1_burn
)
TaskUser.objects.create(user=user, task_id=task.id)
print('STAGE1:', stage)
print(stage.message_id.all(), user.number_of_solved_tasks)
answer_for_user_all = list(stage.message_id.all())#[user.number_of_solved_tasks]
print('ANSWERRR', answer_for_user_all)
for answer_for_user in answer_for_user_all:
if delay==None:
delay = answer_for_user.delay if answer_for_user.delay!=None else 0
print('DELAY', delay)
await asyncio.sleep(delay)
delay=answer_for_user.delay if answer_for_user.delay!=None else 0
print('STAGE2:', stage)
await send_task_information(message.chat.id, answer_for_user, stage)
await send_all_files(user, answer_for_user)
await image_generation(answer_for_user, user)
user.funnel_step+=1
user.save()
end_task = current_task()
print('CURRENT TASK', end_task)
await info_start_tasks(message, task=end_task)
if (
stage.is_generation
and stage.description
and stage.photo
and user.number_of_solved_tasks == 0
):
create_image(user, stage=stage)
with open('send.png', "rb") as image_from_buffer:
await bot.send_photo(
chat_id=user.telegram_id,
photo=image_from_buffer.read()
)
if stage.linked:
ilkeyboard = types.InlineKeyboardMarkup(row_width=4).add(types.InlineKeyboardButton(
text='Ссылка для прохождения',
url=f'{MAIN_URL}{funnel.owner}/{user}'
))
await bot.send_message(
chat_id=user.telegram_id,
text='Этот этап необходимо пройти на сайте',
reply_markup=ilkeyboard,
)
count = 0
for button in answer_for_user.buttons.all():
count += 1
if button.button_type == 'Ссылка на ресурс':
count -= 1
if count == 0 and (not stage.with_open_answer or not (answer_for_user == list(stage.message_id.all())[-1])):
user.number_of_solved_tasks += 1
user.save()
print('FUNC 44444')
#await info_start_tasks(message, next_stage=next_stage)
except Http404 as error:
await handle_http4044_error(message.chat.id, error)
except IndexError:
await handle_index_error(user, funnel, message, next_stage)
except BotBlocked:
await bot_blocked_error(user, funnel)
except TimeoutError:
await handle_timeout_error(message.chat.id)
except ValueError:
answer, keyboard, _, _ = create_answer('Stage_matching_query_does_not_exist')
return await bot.send_message(
chat_id=user.telegram_id,
text=answer.message_text.replace('<br>', '\n'),
reply_markup=keyboard,
parse_mode='HTML'
)
except Exception as error:
await handle_exception(message.chat.id, error)