I am Unable to rename Google Cloud Storage object, Following is the simple code i tried with, but
$core_url = 'gs://store.lonel.com/F9BEA944A8543F.jpg';
$ctx = [
'gs' => [
'enable_cache' => true,
'enable_optimistic_cache' => true,
'read_cache_expiry_seconds' => 300,
$ctx_res = stream_context_set_default($ctx);
if (false == rename($core_url, 'gs://store.lonel.com/MMMF9BEA944A8543F.jpg',$ctx_res))
die('Could not rename.');
echo 'Done renaming';
Warning: Unable to rename: gs://store.lonel.com/MMMF9BEA944A8543F.jpg.
Cloud Storage Error: NOT FOUND in C:\Program
on line 77
Are you running this AppEngine app locally and trying to rename a real object in Google Cloud Storage? When you run the AppEngine development server locally, AppEngine emulates connecting to Google Cloud Storage, but it does not communicate with the real thing. You may be trying to access an object that exists in Google Cloud Storage but does not exist in the local, emulated environment.
Note that this is not the case for accessing Google Cloud Storage through the Google API Python Client (which you're not using), which is separate from App Engine and contacts the real Google Cloud Storage regardless of which App Engine environment it runs in.