Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unable to Upload Files Larger than 2GB to Firebase Storage

オープン
#2,608 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
firebase, node.js, typescript
領域
backend, cloud

調査の方向性

提供されている uploadFileViaStream 関数から始め、2GBを超えるファイルを使って Node.js 上の Firebase Storage SDK 10.12.2 で失敗を再現し、その後、記載されている 1.8GB のケースと比較します。Gaxios EPROTO リクエストを追跡して、問題が SDK のアップロードパスにあるのか、その使用方法にあるのかを特定します。原因とサポートされている解決策が明確に確立されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

needs-triage
[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:
  1. Attempt to upload a file larger than 2GB using the Firebase Storage SDK in a Node.js application.
  2. 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firebase/firebase-admin-node のほかの issue

firebase/firebase-admin-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。