I cretaed a vm in compute engine, and I opened jupyter-notebook, I can read file in my bucket but can't save other. I created the bucket and the vm myself, so I guess I am an ownner?
import pandas as pd
df = pd.read("gs://my-bucket/my_file_v1.csv")
#some code in here
df.to_csv("gs://my-bucket/my_file_2.csv") #I get this error OSError: Forbidden: https://storage.googleapis.com/upload/storage/v1/b/pacific_peche/o Access denied.
I tried to change the IAM policy, the bucket is in not public
and I dded me as principal and I give it the permission needed: Cloud storage viewer
Cloud storage admin ...
It's a common mistake. When you create a Compute Engine, with default parameters, the console propose to use the default compute engine service account as identity of your Compute engine
The legacy behavior is when you use the default compute engine service account the subsequent scope applies. If you click on "set access for each API" you will see the default scope set on your service account: Cloud Storage is in read only mode
Therefore, your error
To solve that, 2 solutions.
Firstly stop the Compute Engine and edit it.