We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operating System
Browser Version
Firebase SDK Version
Firebase SDK Product:
NPM and NODE: I'm using nestJS (@10.3.9), nodeJS (v20.11.1) and npm 10.2.4
I am experiencing an issue where attempting to upload files larger than 2GB to Firebase Storage results in a GaxiosError: request to https://storage.googleapis.com/upload/storage/v1/b/[...] failed, reason: write EPROTO.
However, smaller files (e.g., 1.8GB) upload without any issues.
Failed to upload file. GaxiosError: request to [https://storage.googleapis.com/upload/storage/v1/b/...] failed, reason: write EPROTO at Gaxios._request (/path/to/project/node_modules/gaxios/src/gaxios.ts:157:13) type: 'system', errno: 'EPROTO', code: 'EPROTO'
Here is a sample of the TypeScript function used for uploading:
import { Stream } from 'stream'; import { getStorageAdmin } from 'path-to-your-storage-admin-utils'; async uploadFileViaStream(fileStream: Stream, path: string): Promise<string> { console.debug('Uploading file to storage using stream...'); const storage = getStorageAdmin(); const bucket = storage.bucket('voicecheap-c1f14.appspot.com'); const fileRef = bucket.file(path); const contentType = path.split('.').pop() === 'mp3' ? 'audio/mpeg' : 'video/mp4'; // Verify if the file already exists const [exists] = await fileRef.exists(); if (exists) { console.debug('File already exists. Skipping upload.'); return fileRef.publicUrl(); } return new Promise((resolve, reject) => { fileStream .pipe( fileRef.createWriteStream({ contentType: contentType, public: true, metadata: { contentType: contentType, mimeType: contentType, type: contentType, }, }), ) .on('error', (error) => { console.error('Failed to upload file.', error); reject(error); throw new InternalServerErrorException('Failed to upload file.'); }) .on('finish', async () => { // Make the file publicly accessible try { await fileRef.makePublic(); console.debug('File uploaded and made public.'); resolve(fileRef.publicUrl()); } catch (error) { console.error('Failed to make the file public.', error); reject(error); throw new InternalServerErrorException( 'Failed to make the file public.', ); } }); }); }
The text was updated successfully, but these errors were encountered:
I found a few problems with this issue:
Sorry, something went wrong.
+1
No branches or pull requests
[REQUIRED] Step 2: Describe your environment
Operating System
Browser Version
Firebase SDK Version
Firebase SDK Product:
NPM and NODE:
I'm using nestJS (@10.3.9), nodeJS (v20.11.1) and npm 10.2.4
[REQUIRED] Step 3: Describe the problem
I am experiencing an issue where attempting to upload files larger than 2GB to Firebase Storage results in a GaxiosError: request to https://storage.googleapis.com/upload/storage/v1/b/[...] failed, reason: write EPROTO.
However, smaller files (e.g., 1.8GB) upload without any issues.
Steps to reproduce:
Relevant Code:
Here is a sample of the TypeScript function used for uploading:
The text was updated successfully, but these errors were encountered: