I'm trying to generate and upload a file to google cloud storage.
Generating the document locally and uploading it to the storage everything works properly. But once the service is deployed I get the error:

```
{
  "code": 500,
  "reason": "Unknow exception",
  "message": "Error: write EPIPE",
  "referenceError": "https://docs.nestjs.com/exception-filters",
  "exceptionText": {
    "errno": "EPIPE",
    "code": "EPIPE",
    "syscall": "write"
  }
}

```

My current method to create the document is:

```
const storage =
      ENDPOINTS.GOOGLE_STORAGE_BUCKET_KEY != ''
        ? new Storage({
            keyFilename: 'myfile.json',
          })
        : new Storage();

const content = '<h1>Hello world!</h1>';

    const myBucket = storage.bucket(ENDPOINTS.STORAGE_BUCKET);
    const file = myBucket.file(filename);
    file.metadata = { contentType: 'application/pdf' };

    await pdf.create(content).toBuffer(async (err, buffer) => {
      //destination: `D2C_D2D_ACTIVITY_SVC/drop_permission/${filename}`,
      console.log(buffer);
      await myBucket
        .file(`path/${filename}`)
        .save(buffer, {
          public: true,
          gzip: true,
          resumable: false,
          validation: false,
          metadata: {
            cacheControl: 'no-cache',
          },
        });

    });

```

Not sure why is not working once the service is deployed and I didn't find any right clue to solve it.
Can someone help me?