# GCP GCS storage using old service account key

**URL:** <https://discuss.elastic.co/t/gcp-gcs-storage-using-old-service-account-key/253545>\
**Category:** Elasticsearch\
**Created:** [October 28, 2020, 10:16am UTC](https://discuss.elastic.co/t/gcp-gcs-storage-using-old-service-account-key/253545 "2020-10-28T10:16:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhuvaneshdct](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhuvaneshdct/32/70081_2.png) [@bhuvaneshdct](https://discuss.elastic.co/u/bhuvaneshdct)\
**Post date:** [October 28, 2020, 10:16am UTC](https://discuss.elastic.co/t/gcp-gcs-storage-using-old-service-account-key/253545/1 "2020-10-28T10:16:04Z")

</div>

I have an existing repository for GCS storage that using a JSON key.

```auto
export PATH=/usr/share/elasticsearch/bin/:$PATH
elasticsearch-keystore add-file gcs.client.default.credentials_file /opt/esadmin/gcs-key.json
elasticsearch-plugin install repository-gcs

```

Then I created the repo it was working fine. Then I need change the JSON key. So what I did, I removed the repository and deleted the Keystore.

```auto
curl -X DELETE https://10.10.10.11:9200/_snapshot/gcs
elasticsearch-keystore remove gcs.client.default.credentials_file

```

Then replaced the JSON file with new service account json file(its from a different GCP project) and add it to key store. Then I tried to create the repo with a different bucket, it is saying, its not able find the bucket.

Error:

```auto
"storage_exception: old-project-es-gcs-repository@old-project.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket."

```

`old-project-es-gcs-repository@old-project.iam.gserviceaccount.com ` --\> this is the old service account, the new account is not taken.

I tried to uninstall and the GCS plugin, but still the same issue.

---

<div class="post-metadata">

**Author:** ![bhuvaneshdct](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhuvaneshdct/32/70081_2.png) [@bhuvaneshdct](https://discuss.elastic.co/u/bhuvaneshdct)\
**Post date:** [October 29, 2020, 11:22am UTC](https://discuss.elastic.co/t/gcp-gcs-storage-using-old-service-account-key/253545/2 "2020-10-29T11:22:59Z")

</div>

I solved by removing the plugin on all the nodes and install it again

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 26, 2020, 11:23am UTC](https://discuss.elastic.co/t/gcp-gcs-storage-using-old-service-account-key/253545/3 "2020-11-26T11:23:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
