Gsutil failing when triggered at transcription end

I wanted to save the newly created transcription to gcloud, but found that gsutil was failing when it was being triggered when a transcription ended.

So I made some tests to demonstrate it better, here’s my config

And the script looks like this

First I executed the script manually

And the text.txt file was uploaded succesfully all normal

If the upload worked manually that means it is gonna work automatically right?
Well I went into a conference, opened transcription, said some words
Then ended it.
This should trigger the script, it was succesfully triggered but the upload to gcloud didn’t go through

I’m new to this and don’t know what could be going wrong, could be a permissions issue from the triggerer script, or the process closing before gsutil finishes.

Would appreciate some help here, thanks.

In your place I’d first try to add a shebang to the script and making sure it’s +x

Hello thanks for your reply, I added a shebang (tried with both /sh and /bash) and made sure that it’s +x, it is still failing tho.

It’s a bit annoying when one can’t say from a post if one is supposed to take it as it is (as it’s obviously wrong) or if it’s just written fast but not accurately and don’t reflect what was really done. I was already tempted to delete my first reply when I noticed that you did not post the exact script but something that ‘looked like’ the actual thing. For computers details matter, so why ask people reading your problem to guess if you did things exactly right or 99% right ?

That is the actual script I’m using to test this case

Maybe my wording was not the best one (Sorry for my bad english)
The text.txt is just a file that has Hello World written in it

If I removed the gsutil line and wrote something else everything would work fine, but that exact line is the one that is not working correctly

I don’t think it’s the script that’s failing here (It is working if run manually after all), could be that the jigasi process doesn’t have enough permissions to execute that gsutil? I’m not sure. Thanks for the help

you mean your really used script actually ignored the file name passed by the caller and tried to send another time the file you already uploaded in your manual test ?

Yeah I’m not using the filename passed by the caller for this test, the script is made only to verify that a file could be uploaded to gcloud.

I have the firebase storage console open in another tab and I can see that the file is being added when doing it manually, afterwards I delete it and open a call, open transcriber and ending the call to execute the script through the post transcription caller, but when I check the firebase console I don’t see any new file being added

So I tried with an even simpler code

Then executed it manually

Everything ok so far
Then I tried it through the caller at transcription end
(/var/log/jitsi/jigasi.log snippet)

And it didn’t go through

has the jigasi user write right on /var/log/jitsi directory ?

I came to the same conclussion, I don’t think I ever gave it those rights.

Right now I’m figuring out how to give the jigasi user sudo permissions

err, ugh. How about
sudo usermod -a -G jitsi jigasi
and restart jigasi

Edit: should be done already by the Debian installer. But maybe you are not using it.

Thanks @gpatel-fr for the support
Regarding gsutil failing, I had to authenticate gcloud inside jigasi
So, after making sure that jigasi is an user with root privileges:

I went inside jigasi

root@dev:~# /bin/su - jigasi

And authenticated with gcloud

jigasi@dev:~$ gcloud auth login

After that everything was working correctly