Problem with uploading files to firebase storage through firebase function
I am currently using firebase function to do video compression, the file is first downloaded from the firebase storage, then through fluent ffmpeg, compress the file. Then, the video is re-uploaded to the firebase storage.
However, the firebase function console shows that there is a error in ffmpeg:
An error occurred: ffmpeg exited with code 1: compressed-Scooter- One (Always Hardcore).mp3: Read-only file system
But the firebase storage rules is set to read and write:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
My code: https://github.com/MobileProjectTPC/VideoCompressor/blob/master/functions/index.js
The upper part is my own code, while the lower part is the testing code from Can you call out to FFMPEG in a Firebase Cloud Function with some changes.
So, I don't understand why the ffmpeg function wasn't able to convert the file. Do any one know why this keeps happening and how to fix it?
Also, the output of the functions for my code is as follows:
While their code is as follows:
As you can see for my code, the error shows up after the output of function finished. While for their code, there isn't any error at all but no compressed file in firebase.
Does this means the fluent-ffmpeg function wasn't even ran at all for their code?
Thank You.
firebase ffmpeg google-cloud-functions firebase-storage
add a comment |
I am currently using firebase function to do video compression, the file is first downloaded from the firebase storage, then through fluent ffmpeg, compress the file. Then, the video is re-uploaded to the firebase storage.
However, the firebase function console shows that there is a error in ffmpeg:
An error occurred: ffmpeg exited with code 1: compressed-Scooter- One (Always Hardcore).mp3: Read-only file system
But the firebase storage rules is set to read and write:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
My code: https://github.com/MobileProjectTPC/VideoCompressor/blob/master/functions/index.js
The upper part is my own code, while the lower part is the testing code from Can you call out to FFMPEG in a Firebase Cloud Function with some changes.
So, I don't understand why the ffmpeg function wasn't able to convert the file. Do any one know why this keeps happening and how to fix it?
Also, the output of the functions for my code is as follows:
While their code is as follows:
As you can see for my code, the error shows up after the output of function finished. While for their code, there isn't any error at all but no compressed file in firebase.
Does this means the fluent-ffmpeg function wasn't even ran at all for their code?
Thank You.
firebase ffmpeg google-cloud-functions firebase-storage
3
Most likely the error is about the file system on which ffmpeg runs, and has nothing to do with permissions on Firebase Storage. But it's hard to say anything conclusive without seeing the minimal code with which to reproduce this problem.
– Frank van Puffelen
Nov 27 '18 at 14:45
3
Note that you can only write local files to /tmp and nowhere else in Cloud Functions.
– Doug Stevenson
Nov 27 '18 at 15:46
I am using my own code for the video compression. But, I also used the code from the post: stackoverflow.com/questions/42773497/… Both my code and their code have the same problem when I run it. Thanks
– Just A Bad Programmer
Nov 28 '18 at 7:20
add a comment |
I am currently using firebase function to do video compression, the file is first downloaded from the firebase storage, then through fluent ffmpeg, compress the file. Then, the video is re-uploaded to the firebase storage.
However, the firebase function console shows that there is a error in ffmpeg:
An error occurred: ffmpeg exited with code 1: compressed-Scooter- One (Always Hardcore).mp3: Read-only file system
But the firebase storage rules is set to read and write:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
My code: https://github.com/MobileProjectTPC/VideoCompressor/blob/master/functions/index.js
The upper part is my own code, while the lower part is the testing code from Can you call out to FFMPEG in a Firebase Cloud Function with some changes.
So, I don't understand why the ffmpeg function wasn't able to convert the file. Do any one know why this keeps happening and how to fix it?
Also, the output of the functions for my code is as follows:
While their code is as follows:
As you can see for my code, the error shows up after the output of function finished. While for their code, there isn't any error at all but no compressed file in firebase.
Does this means the fluent-ffmpeg function wasn't even ran at all for their code?
Thank You.
firebase ffmpeg google-cloud-functions firebase-storage
I am currently using firebase function to do video compression, the file is first downloaded from the firebase storage, then through fluent ffmpeg, compress the file. Then, the video is re-uploaded to the firebase storage.
However, the firebase function console shows that there is a error in ffmpeg:
An error occurred: ffmpeg exited with code 1: compressed-Scooter- One (Always Hardcore).mp3: Read-only file system
But the firebase storage rules is set to read and write:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
My code: https://github.com/MobileProjectTPC/VideoCompressor/blob/master/functions/index.js
The upper part is my own code, while the lower part is the testing code from Can you call out to FFMPEG in a Firebase Cloud Function with some changes.
So, I don't understand why the ffmpeg function wasn't able to convert the file. Do any one know why this keeps happening and how to fix it?
Also, the output of the functions for my code is as follows:
While their code is as follows:
As you can see for my code, the error shows up after the output of function finished. While for their code, there isn't any error at all but no compressed file in firebase.
Does this means the fluent-ffmpeg function wasn't even ran at all for their code?
Thank You.
firebase ffmpeg google-cloud-functions firebase-storage
firebase ffmpeg google-cloud-functions firebase-storage
edited Nov 28 '18 at 7:54
Just A Bad Programmer
asked Nov 27 '18 at 14:15
Just A Bad ProgrammerJust A Bad Programmer
346
346
3
Most likely the error is about the file system on which ffmpeg runs, and has nothing to do with permissions on Firebase Storage. But it's hard to say anything conclusive without seeing the minimal code with which to reproduce this problem.
– Frank van Puffelen
Nov 27 '18 at 14:45
3
Note that you can only write local files to /tmp and nowhere else in Cloud Functions.
– Doug Stevenson
Nov 27 '18 at 15:46
I am using my own code for the video compression. But, I also used the code from the post: stackoverflow.com/questions/42773497/… Both my code and their code have the same problem when I run it. Thanks
– Just A Bad Programmer
Nov 28 '18 at 7:20
add a comment |
3
Most likely the error is about the file system on which ffmpeg runs, and has nothing to do with permissions on Firebase Storage. But it's hard to say anything conclusive without seeing the minimal code with which to reproduce this problem.
– Frank van Puffelen
Nov 27 '18 at 14:45
3
Note that you can only write local files to /tmp and nowhere else in Cloud Functions.
– Doug Stevenson
Nov 27 '18 at 15:46
I am using my own code for the video compression. But, I also used the code from the post: stackoverflow.com/questions/42773497/… Both my code and their code have the same problem when I run it. Thanks
– Just A Bad Programmer
Nov 28 '18 at 7:20
3
3
Most likely the error is about the file system on which ffmpeg runs, and has nothing to do with permissions on Firebase Storage. But it's hard to say anything conclusive without seeing the minimal code with which to reproduce this problem.
– Frank van Puffelen
Nov 27 '18 at 14:45
Most likely the error is about the file system on which ffmpeg runs, and has nothing to do with permissions on Firebase Storage. But it's hard to say anything conclusive without seeing the minimal code with which to reproduce this problem.
– Frank van Puffelen
Nov 27 '18 at 14:45
3
3
Note that you can only write local files to /tmp and nowhere else in Cloud Functions.
– Doug Stevenson
Nov 27 '18 at 15:46
Note that you can only write local files to /tmp and nowhere else in Cloud Functions.
– Doug Stevenson
Nov 27 '18 at 15:46
I am using my own code for the video compression. But, I also used the code from the post: stackoverflow.com/questions/42773497/… Both my code and their code have the same problem when I run it. Thanks
– Just A Bad Programmer
Nov 28 '18 at 7:20
I am using my own code for the video compression. But, I also used the code from the post: stackoverflow.com/questions/42773497/… Both my code and their code have the same problem when I run it. Thanks
– Just A Bad Programmer
Nov 28 '18 at 7:20
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53501685%2fproblem-with-uploading-files-to-firebase-storage-through-firebase-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53501685%2fproblem-with-uploading-files-to-firebase-storage-through-firebase-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Most likely the error is about the file system on which ffmpeg runs, and has nothing to do with permissions on Firebase Storage. But it's hard to say anything conclusive without seeing the minimal code with which to reproduce this problem.
– Frank van Puffelen
Nov 27 '18 at 14:45
3
Note that you can only write local files to /tmp and nowhere else in Cloud Functions.
– Doug Stevenson
Nov 27 '18 at 15:46
I am using my own code for the video compression. But, I also used the code from the post: stackoverflow.com/questions/42773497/… Both my code and their code have the same problem when I run it. Thanks
– Just A Bad Programmer
Nov 28 '18 at 7:20