Skip to content

Commit 4ab4fb4

Browse files
authored
Improve Google oauth2 credentials method in README (#7)
* Add two images for the readme * Update README.md modify the earthengine set_project and add errors examples to the README * Add the project not registered error * Update the common errors part in the README.md
1 parent 64c0c92 commit 4ab4fb4

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ private, don't share it or people can use your Earth Engine resources.
3737
Google Cloud projects. You'll need to specify a project when you initialize to Earth Engine services.
3838
One way to do that is to include a default project in your credentials file. Here we add one using the
3939
`earthengine set_project` command. Be sure to edit the project ID to one that you want associated
40-
with running tests in your GitHub repo.
40+
with running tests in your GitHub repo.
41+
42+
To check you existing projects ids you can use the following command
4143

4244
```shell
43-
earthengine authenticate --force <YOUR-PROJECT-ID>
45+
gcloud projects list
46+
```
47+
48+
To include a default project in your credentials file, use the following command:
49+
50+
```shell
51+
earthengine set_project <YOUR-PROJECT-ID>
4452
```
4553

4654
The given project will now appear in the credentials file just created.
@@ -125,9 +133,29 @@ Earth Engine servers 😁
125133

126134
![image](https://github.com/user-attachments/assets/280082ef-7caa-419e-8fa2-795bc1e888d1)
127135

136+
### Possible Errors
137+
138+
While running the workflow, you may encounter the following errors:
139+
140+
#### Error 1: Google Earth Engine API Not Enabled
128141

142+
```shell
143+
ee.ee_exception.EEException: Google Earth Engine API has not been used in project projectid before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/earthengine.googleapis.com/overview?project=projectid then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
144+
```
145+
146+
- ![Enable Google Earth Engine API](https://github.com/thekester/ee-initialize-github-actions/blob/google-oauth2-credentials/enablegoogleeartengineapi.png)
147+
148+
To resolve this, **enable the Google Earth Engine API** by visiting the following link: [Enable Google Earth Engine API](https://console.developers.google.com/apis/api/earthengine.googleapis.com/overview?project=projectid). If you enabled the API recently, please wait a few minutes for the changes to propagate before retrying.
129149

150+
- ![Click Enable Button](https://github.com/thekester/ee-initialize-github-actions/blob/google-oauth2-credentials/buttonenablegoogleearthengineapi.png)
130151

152+
#### Error 2: API Disabled for Specific Project
153+
154+
```shell
155+
ee.ee_exception.EEException: Google Earth Engine API has not been used in project gitactions-idfederation before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/earthengine.googleapis.com/overview?project=gitactions-idfederation then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
156+
```
131157

158+
- ![Project Not Registered](https://github.com/thekester/ee-initialize-github-actions/blob/google-oauth2-credentials/projectnotregistered.png)
132159

160+
Again, you'll need to **enable the Google Earth Engine API** for the specified project by visiting the following link: [Enable API for gitactions-idfederation](https://console.developers.google.com/apis/api/earthengine.googleapis.com/overview?project=gitactions-idfederation). Please wait a few minutes if the API was recently enabled.
133161

103 KB
Loading

enablegoogleeartengineapi.png

90.9 KB
Loading

projectnotregistered.png

83.6 KB
Loading

0 commit comments

Comments
 (0)