Repository navigation
The problem with access to the file after it is moved #1009
Description
Activity
- addedapi: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Dec 8, 2015 Thanks for reporting this! I was able to reproduce this. It doesn't look like our code is doing anything wrong in this situation. I wonder if this is an upstream issue? @jgeewax
Also, here is the example converted to JS for us non-:coffee: folk :) https://gist.github.com/stephenplusplus/5bf537da70df0c9db36c
I'm having a bit of trouble following, are you saying:
- Create a file
- Move the file
- Get a signed URL
- Signed URL is invalid
?
Yep, and the signed url works when it's done before the move (move = copy to new file and delete original).
Found solution
var fileOptions = { action: 'read', expires: '01-01-2100' };should be inside uploadStream and move functions, because getSignedUrl added "recource" prop to this object, which causes error
That sounds about right. If we're modifying the
fileOptionsobject, those changes would be sticky and carry over to the next call, right?Can we maybe operate on a copy of the configuration ...?
Good catch, sorry I missed that.
I'm actually going to re-open this for @stephenplusplus to look at today :)
- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
on Dec 9, 2015 - added a commit that references this issue
on Nov 11, 2022 - added a commit that references this issue
on Jul 23, 2025 - added a commit that references this issue
on Jan 28, 2026 - added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 17, 2026 - added a commit that references this issue
on Mar 5, 2026
For example I uploaded Labs.all.screens.pdf into my backet 'aifiles'.
I get a link to the file as follows (coffescript)
And file link works for me.
https://storage.googleapis.com/aifiles/uploads%2Fapps%2Facme_theme_park%2F9a52117f-0254-4967-b97f-569fbfb0542b%2FLabs.all.screens.pdf?GoogleAccessId=850766160460-cjosh1hn0tfqn1d2efenvcgm0hcoi5gf@developer.gserviceaccount.com&Expires=4102444800&Signature=bqPGuzFRzRYVlWtBvbRbGXEnZZzkFs5ap%2B2OBOklWW9LM0WttBL%2BGTqQAJhlkOpihpPz5vg1DYdPsaLzdcJ6U8OFwsOHZiwJfyxNTwwi32RAWhU%2FfIC3MnOjMpT%2BB1irudspHfwPaDK6XvtBAhBnqn%2FmFBR%2FUsCaLLpxweFsHf8bZuFnAuOwU87VFgMSbB4GveVFxU2n6LRY9JTPhMhkASCnqRk26H7BmfKmEnS9LIHeaLynQyZoqrwuCN%2F74%2FFCSeAaL4886E1sw055EXtiWUmGtx9E%2FlqYj34d0XKau7%2B4JrVpU9sxHqqtd9IskDpSNu8ptk%2FaHoueqTKkD6kmsA%3D%3D
But after moving the file as follows (coffescript):
new file link doesn't work for me:
https://storage.googleapis.com/aifiles/uploads%2Fapps%2Facme_theme_park%2F9a52117f-0254-4967-b97f-569fbfb0542b%2FLabs.pdf?GoogleAccessId=850766160460-cjosh1hn0tfqn1d2efenvcgm0hcoi5gf@developer.gserviceaccount.com&Expires=4102444800&Signature=rZ5PZwpY8f9jhsMIBr%2BDw49cFe39mc89N%2FCT6iy067ahtT4xnO%2FV8Tn%2F3SFXAP9GaQzX9ijzrUTqxwXlyDRTqz02vxBjwaxYAsLYI8hNrYa0ilWklCYn6f0c6%2BMeGXB%2B9h7BNJHQbXLHeYQrvaLoA0B0ZryIwzCsXiVsw6cmh26x2KAqZ2vcNos%2Fl3G1kUBDGmcUtc4bSdS0sKgO45FIRQmYqowjr5QPi%2FqjftucBlSNll%2BFPv62KQyIV0xEnRYhyoIabTd37BzSkSrjApJZOEBYakA6I6Lesuhjq%2B6AD3Z7rMks%2Bp85vh%2BatMmrTcTmuBXlLGRJz1McciAPisph9w%3D%3D
Now I tryed upload other file once again and in this time I have a problem with first link
Full code: