TomFrankly / pipedream-notion-voice-notes

Take notes with your voice and send them to Notion
103 stars 55 forks source link

"An error occured while attempting to split the file into chunks, or while sending the chunks to OpenAI" #34

Closed rplmaxwell closed 11 months ago

rplmaxwell commented 11 months ago

Hi!

Here is the error I'm receiving:

Error An error occured while attempting to split the file into chunks, or while sending the chunks to OpenAI. If the full error below says "Unidentified connection error", please double-check that you have entered valid billing info in your OpenAI account. Afterward, generate a new API key and enter it in the OpenAI app here in Pipedream. Then, try running the workflow again. If that does not work, please open an issue at this workflow's Github repo: https://github.com/TomFrankly/pipedream-notion-voice-notes/issues Full error from OpenAI: Connection error.

DETAILS at Object.chunkFileAndTranscribe (file:///tmp/pdg/dist/code/4cf355a52ab0f9c275ba953eea42492276c4b796f961fdffefa87942b1ced4df/code/Notion-Voice-Notes.mjs:391:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at Object.run (file:///tmp/pdg/dist/code/4cf355a52ab0f9c275ba953eea42492276c4b796f961fdffefa87942b1ced4df/code/Notion-Voice-Notes.mjs:1901:22) at null.executeComponent (/var/task/launch_worker.js:242:22) at MessagePort.messageHandler (/var/task/launch_worker.js:748:28)


And here are the logs:

10/24/2023, 9:42:02 AM Checking that file is under 300mb...

10/24/2023, 9:42:02 AM File size is approximately 40.3mb.

10/24/2023, 9:42:02 AM File is under the size limit. Continuing...

10/24/2023, 9:42:02 AM Checking if the user set languages...

10/24/2023, 9:42:02 AM No language set. Whisper will attempt to detect the language.

10/24/2023, 9:42:02 AM Downloaded file to tmp storage:

10/24/2023, 9:42:02 AM { path: '/tmp/5fc8a000-7c9f-4437-ab79-24bfcb7a973c.mp3', mime: '.mp3' }

10/24/2023, 9:42:02 AM Successfully got duration: 2516 seconds

10/24/2023, 9:42:02 AM Chunking file: /tmp/5fc8a000-7c9f-4437-ab79-24bfcb7a973c.mp3

10/24/2023, 9:42:02 AM Spliting file into chunks with ffmpeg command: /tmp/pdg/dist/code/4cf355a52ab0f9c275ba953eea42492276c4b796f961fdffefa87942b1ced4df/node_modules/.pnpm/@ffmpeg-installer+ffmpeg@1.1.0/node_modules/@ffmpeg-installer/linux-x64/ffmpeg -i "/tmp/5fc8a000-7c9f-4437-ab79-24bfcb7a973c.mp3" -f segment -segment_time 1259 -c copy -loglevel verbose "/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-%03d.mp3"

10/24/2023, 9:42:03 AM stderr: ffmpeg version N-47683-g0e8eb07980-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg libavutil 56. 24.101 / 56. 24.101 libavcodec 58. 42.100 / 58. 42.100 libavformat 58. 24.100 / 58. 24.100 libavdevice 58. 6.101 / 58. 6.101 libavfilter 7. 46.101 / 7. 46.101 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 libpostproc 55. 4.100 / 55. 4.100 [mp3 @ 0x7145c80] Skipping 0 bytes of junk at 65536. [mp3 @ 0x7145c80] Estimating duration from bitrate, this may be inaccurate Input #0, mp3, from '/tmp/5fc8a000-7c9f-4437-ab79-24bfcb7a973c.mp3': Metadata: title : Adam Sobel Interview-edited2 encoded_by : Hindenburg PRO 1.90.2456 date : 2023 Duration: 00:41:56.64, start: 0.000000, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s [segment @ 0x7149a00] Selected stream id:0 type:audio [segment @ 0x7149a00] Opening '/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-000.mp3' for writing Output #0, segment, to '/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-%03d.mp3': Metadata: title : Adam Sobel Interview-edited2 encoded_by : Hindenburg PRO 1.90.2456 date : 2023 encoder : Lavf58.24.100 Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help [segment @ 0x7149a00] segment:'/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-000.mp3' starts with packet stream:0 pts:0 pts_time:0 frame:0 [segment @ 0x7149a00] segment:'/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-000.mp3' count:0 ended [AVIOContext @ 0x71708c0] Statistics: 1 seeks, 78 writeouts [segment @ 0x7149a00] Opening '/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-001.mp3' for writing [segment @ 0x7149a00] segment:'/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-001.mp3' starts with packet stream:0 pts:17767342080 pts_time:1259.02 frame:48197 size=N/A time=00:36:49.28 bitrate=N/A speed=4.42e+03x No more output streams to write to, finishing. [segment @ 0x7149a00] segment:'/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-001.mp3' count:1 ended [AVIOContext @ 0x7145b00] Statistics: 1 seeks, 78 writeouts size=N/A time=00:41:56.61 bitrate=N/A speed=4.4e+03x video:0kB audio:39322kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Input file #0 (/tmp/5fc8a000-7c9f-4437-ab79-24bfcb7a973c.mp3): Input stream #0:0 (audio): 96340 packets read (40266187 bytes); Total: 96340 packets (40266187 bytes) demuxed Output file #0 (/tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY/chunk-%03d.mp3): Output stream #0:0 (audio): 96340 packets muxed (40266187 bytes); Total: 96340 packets (40266187 bytes) muxed [AVIOContext @ 0x714e9c0] Statistics: 40331851 bytes read, 0 seeks

10/24/2023, 9:42:03 AM Chunks created successfully. Transcribing chunks: chunk-000.mp3,chunk-001.mp3

10/24/2023, 9:42:03 AM Transcribing file: chunk-000.mp3

10/24/2023, 9:42:03 AM Transcribing file: chunk-001.mp3

10/24/2023, 9:43:25 AM Attempting to clean up the /tmp/ directory...

10/24/2023, 9:43:25 AM Cleaning up /tmp/chunks-2XDZgA9RLvsraQkh0pET9RMVLZY...

10/24/2023, 9:43:25 AM ACTIVE_HANDLE This step was still trying to run code when the step ended. Make sure you promisify callback functions and await all Promises. (Reason: TLSSocket, Learn more: https://pipedream.com/docs/code/nodejs/async/)


A few additional notes:

If I can provide any additional information, please let me know!

TomFrankly commented 11 months ago

@rplmaxwell thanks for these details! Have you tried running the workflow again, or with with a different file?

If it's not the billing issue, I'm not sure there's anything else we can really do on our side to debug this. It seems like an OpenAI-specific problem. Perhaps their service was degraded when you tried this run?

rplmaxwell commented 11 months ago

Thanks, Thomas. I ended up getting it to work this morning. Maybe it was an OpenAI specific problem after all? I didn't even change anything. Appreciate you looking into it.

I've already used it to transcribe 10 podcasts I don't have the time to listen to. Excited for when this thing can distinguish between speakers!