flaree / flare-cogs

Various cogs written for Red-DiscordBot
MIT License
76 stars 69 forks source link

Stickbug returns error when run #139

Closed chrys-the-flower closed 2 years ago

chrys-the-flower commented 2 years ago

Describe the bug When trying to run the !stick command on an image the process fails and the bot messages "An error occured during the creation of the stick bugged video". The plugin worked when I installed it a few weeks ago, but when someone tried to use it last night it wouldn't work. I'm using this docker container to run my bot https://github.com/PhasecoreX/docker-red-discordbot. I have already tried rebooting the system, updating the docker container, and updating my installed cogs.

Here is the console output from when the command is run:

Moviepy - Building video /data/cogs/StickBugged/916373653183164457stick.mp4. MoviePy - Writing audio in 916373653183164457stickTEMP_MPY_wvf_snd.mp3 chunk: 0%| | 0/341 [00:00<?, ?it/s, now=None]

chunk: 8%|▊ | 27/341 [10:59:08<127:45:37, 1464.77s/it, now=None]

chunk: 8%|▊ | 27/341 [10:59:08<127:45:37, 1464.77s/it, now=None] [2021-12-03 09:01:45] [ERROR] red.flare.stick: Error sending stick bugged video Traceback (most recent call last): File "/data/cogs/Downloader/lib/moviepy/audio/io/ffmpeg_audiowriter.py", line 74, in write_frames self.proc.stdin.write(frames_array.tobytes()) BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/cogs/CogManager/cogs/stickbugged/stickbugged.py", line 78, in stick video_file = await asyncio.wait_for(task, timeout=300)

File "/usr/local/lib/python3.8/asyncio/tasks.py", line 494, in wait_for return fut.result()

File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs)

File "/data/cogs/CogManager/cogs/stickbugged/stickbugged.py", line 43, in blocking video.write_videofile(

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 135, in use_clip_fps_by_default return f(clip, *new_a, **new_kw)

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 22, in convert_masks_to_RGB return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/moviepy/video/VideoClip.py", line 293, in write_videofile self.audio.write_audiofile(audiofile, audio_fps,

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/moviepy/audio/AudioClip.py", line 206, in write_audiofile return ffmpeg_audiowrite(self, filename, fps, nbytes, buffersize,

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/moviepy/audio/io/ffmpeg_audiowriter.py", line 170, in ffmpeg_audiowrite writer.write_frames(chunk)

File "/data/cogs/Downloader/lib/moviepy/audio/io/ffmpeg_audiowriter.py", line 117, in write_frames raise IOError(error)

OSError: [Errno 32] Broken pipe MoviePy error: FFMPEG encountered the following error while writing file 916373653183164457stickTEMP_MPY_wvf_snd.mp3: b'916373653183164457stickTEMP_MPY_wvf_snd.mp3: Permission denied\n' In case it helps, make sure you are using a recent version of FFMPEG (the versions in the Ubuntu/Debian repos are deprecated).`

flaree commented 2 years ago

Can you ensure that ffmpeg is up to date, it may stem from using an unsupported hosting in which I will not provide support for.

I will have a look into this around Wednesday after my first set of exams pass.

On Fri 3 Dec 2021, 17:09 Mfdas, @.***> wrote:

Describe the bug When trying to run the !stick command on an image the process fails and the bot messages "An error occured during the creation of the stick bugged video". The plugin worked when I installed it a few weeks ago, but when someone tried to use it last night it wouldn't work. I'm using this docker container to run my bot https://github.com/PhasecoreX/docker-red-discordbot. I have already tried rebooting the system, updating the docker container, and updating my installed cogs.

Here is the console output from when the command is run:

Moviepy - Building video /data/cogs/StickBugged/916373653183164457stick.mp4. MoviePy - Writing audio in 916373653183164457stickTEMP_MPY_wvf_snd.mp3 chunk: 0%| | 0/341 [00:00<?, ?it/s, now=None]

chunk: 8%|▊ | 27/341 [10:59:08<127:45:37, 1464.77s/it, now=None]

chunk: 8%|▊ | 27/341 [10:59:08<127:45:37, 1464.77s/it, now=None] [2021-12-03 09:01:45] [ERROR] red.flare.stick: Error sending stick bugged video Traceback (most recent call last): File "/data/cogs/Downloader/lib/moviepy/audio/io/ffmpeg_audiowriter.py", line 74, in write_frames self.proc.stdin.write(frames_array.tobytes()) BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/cogs/CogManager/cogs/stickbugged/stickbugged.py", line 78, in stick video_file = await asyncio.wait_for(task, timeout=300)

File "/usr/local/lib/python3.8/asyncio/tasks.py", line 494, in wait_for return fut.result()

File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs)

File "/data/cogs/CogManager/cogs/stickbugged/stickbugged.py", line 43, in blocking video.write_videofile(

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 135, in use_clip_fps_by_default return f(clip, *new_a, **new_kw)

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 22, in convert_masks_to_RGB return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/moviepy/video/VideoClip.py", line 293, in write_videofile self.audio.write_audiofile(audiofile, audio_fps,

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/moviepy/audio/AudioClip.py", line 206, in write_audiofile return ffmpeg_audiowrite(self, filename, fps, nbytes, buffersize,

File "/data/cogs/Downloader/lib/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw)

File "/data/cogs/Downloader/lib/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k)

File "/data/cogs/Downloader/lib/moviepy/audio/io/ffmpeg_audiowriter.py", line 170, in ffmpeg_audiowrite writer.write_frames(chunk)

File "/data/cogs/Downloader/lib/moviepy/audio/io/ffmpeg_audiowriter.py", line 117, in write_frames raise IOError(error)

OSError: [Errno 32] Broken pipe MoviePy error: FFMPEG encountered the following error while writing file 916373653183164457stickTEMP_MPY_wvf_snd.mp3: b'916373653183164457stickTEMP_MPY_wvf_snd.mp3: Permission denied\n' In case it helps, make sure you are using a recent version of FFMPEG (the versions in the Ubuntu/Debian repos are deprecated).`

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/flaree/flare-cogs/issues/139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHQXU6AOLOENNR2JWUF37ETUPD2TJANCNFSM5JKFFFVQ .

flaree commented 2 years ago

Installing ffmpeg will solve your issue, how you go about doing that with an unsupported environment is up to you.