Unable to Run Cloud Forest Demo -- RuntimeError: GS_SECRET_ACCESS_KEY configuration option not defined

17 views
Skip to first unread message

Casey McGonigle

unread,
May 20, 2022, 5:49:57 PM5/20/22
to California Forest Observatory Community, Joyce Li, Jenna Morabito, Kaavya Shah, Meer Wu
Hi all,

I'm a new user of the Forest Observatory API and am very excited by the features you've put together! Thank you.

I'm running through the demo notebooks to familiarize myself with the API but am unable to work all the way through the cloud forest demo notebook.

Here's what I've done:
  1. Open the Cloud Forest Demo Notebook in Google Colab
  2. Authorize & Initialize Earth Engine & run the cell that defines the pixel_project() function
  3. Work through Section 1 -- this is where my trouble begins.
    1. See the attached screenshot for my code and error message here
    2. As per this stack overflow post, I've created a gs_access_key_id and gs_secret_access_key in my Google Cloud Platform project, but am unsure how to use these keys to fix my problem.
Please let me know how I can workaround this "RuntimeError: GS_SECRET_ACCESS_KEY configuration option not defined" error and start rendering your great data!

Thanks,
Casey

Screen Shot 2022-05-20 at 2.45.02 PM.png

Christopher Anderson

unread,
Jul 1, 2022, 9:04:27 PM7/1/22
to California Forest Observatory Community, Casey McGonigle, Joyce Li, Jenna Morabito, Kaavya Shah, Meer Wu
Hi Casey et al.,

Apologies for the slow reply.

It looks like GDAL updated how they manage Google Cloud authentication. D'oh!

But I think I may have fixed the issue on our backend with no additional effort required on your part. Please try and rerun those code blocks and let me know if the error persists.

If it does persist, you might find some useful information on GDAL's virtual raster driver guide. I think there are two options you can try out below.

Open public access
It looks like the first option in the GCP guide might work well, where you set the environment variable "GS_NO_SIGN_REQUEST=YES". This should work because the Forest Observatory bucket is set to public read access. But I haven't tested it before (requires gdal >3.4, so be sure to upgrade before trying).

You'll just need to set that as an environment variable. You could either do that via your machine (say, in your `$HOME/.bashrc` file on linux or mac, or [google how to do this] on Windows), or you can set them within python like this:

import os
os.environ["GS_NO_SIGN_REQUEST"] = "YES"

Add that to a code block in the notebook somewhere before making the pixel_project call and I think you'll be good.

If you try this and it works, please let me know and I'll make that update to the cfo python API to handle this automatically for users. The bucket is public but google makes you authenticate anyway which.... would be great to workaround.

Using your own GCP ID
I think you've done most of the work you would need to do regarding setting up your access key and key ID. I think the last remaining task would be to set those values that you got from the stack overflow post as environment variables. Again from python:

os.environ["GS_SECRET_ACCESS_KEY"] = "your_access_key"
os.environ["GS_ACCESS_KEY_ID"] = "your_key_id"

Cheers,
Reply all
Reply to author
Forward
0 new messages