Unable to Upload Files Larger than 2GB to Firebase Storage
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- firebase, node.js, typescript
調査の方向性
提供されている uploadFileViaStream 関数から始め、2GBを超えるファイルを使って Node.js 上の Firebase Storage SDK 10.12.2 で失敗を再現し、その後、記載されている 1.8GB のケースと比較します。Gaxios EPROTO リクエストを追跡して、問題が SDK のアップロードパスにあるのか、その使用方法にあるのかを特定します。原因とサポートされている解決策が明確に確立されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
[REQUIRED] Step 2: Describe your environment
Operating System
- MAC OS SONOMA 14.5
Browser Version
- ARC (CHROME)
Firebase SDK Version
- 10.12.2
Firebase SDK Product:
- Storage
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:
- Attempt to upload a file larger than 2GB using the Firebase Storage SDK in a Node.js application.
- Encounter the following error:
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'
Relevant Code:
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.',
);
}
});
});
}
- 主要言語
- TypeScript
- スター
- 1.7k
- フォーク
- 419
- 平均マージ
- 4日 20時間
- マージ済み PR(30日)
- 16
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-admin-node のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · コメント 3 件 · 担当者 1 名 ·
-
api: messaging
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · コメント 1 件 · 担当者 1 名 ·
firebase/firebase-admin-node の issue をすべて見る
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100