Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQueryException when patching a table does not contain propagated error codes #1391

Closed
mtagle opened this issue Nov 11, 2016 · 2 comments
Closed
Assignees

Comments

@mtagle
Copy link

mtagle commented Nov 11, 2016

It looks like there are other flows that also don’t propagate error codes, but this particular one is what I saw.

I noticed this when I was updating a table. Our code has retry logic if the returned BigQueryException has an error code of 403.

relevant code lines:
https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/DefaultBigQueryRpc.java#L206

https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/DefaultBigQueryRpc.java#L93

GoogleJsonResponseException is a subclass of IOException, but the error code there isn't ending up in the wrapping BigQueryException.

The part of my stack trace that lead me to this conclusion:

Caused by: com.google.cloud.bigquery.BigQueryException: Exceeded rate limits: Your table exceeded quota for table.insert or table.update per table. For more information, see https://cloud.google.com/bigquery/troubleshooting-errors

at com.google.cloud.bigquery.spi.DefaultBigQueryRpc.translate(DefaultBigQueryRpc.java:93)
at com.google.cloud.bigquery.spi.DefaultBigQueryRpc.patch(DefaultBigQueryRpc.java:218)
at com.google.cloud.bigquery.BigQueryImpl$10.call(BigQueryImpl.java:329)
at com.google.cloud.bigquery.BigQueryImpl$10.call(BigQueryImpl.java:326)
at com.google.cloud.RetryHelper.doRetry(RetryHelper.java:179)
at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:244)
at com.google.cloud.bigquery.BigQueryImpl.update(BigQueryImpl.java:325)
at com.wepay.kafka.connect.bigquery.SchemaManager.updateSchema(SchemaManager.java:57)
at com.wepay.kafka.connect.bigquery.write.row.AdaptiveBigQueryWriter.performWriteRequest(AdaptiveBigQueryWriter.java:86)
at com.wepay.kafka.connect.bigquery.write.row.BigQueryWriter.writeRows(BigQueryWriter.java:158) <— catching the 403 was expected to happen around here.
at com.wepay.kafka.connect.bigquery.write.batch.DynamicBatchWriter.seekingWriteAll(DynamicBatchWriter.java:131)
... 7 more
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "location" : "table.write",
    "locationType" : "other",
    "message" : "Exceeded rate limits: Your table exceeded quota for table.insert or table.update per table. For more information, see https://cloud.google.com/bigquery/troubleshooting-errors",
    "reason" : "rateLimitExceeded"
  } ],
  "message" : "Exceeded rate limits: Your table exceeded quota for table.insert or table.update per table. For more information, see https://cloud.google.com/bigquery/troubleshooting-errors"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.cloud.bigquery.spi.DefaultBigQueryRpc.patch(DefaultBigQueryRpc.java:213)
... 16 more
@mziccard
Copy link
Contributor

Hi @mtagle!

I am not able to reproduce this on the latest version of google-cloud (0.5.1). Which version are you using?

I tried the following code:

String tableName = "test_update_table";
StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA);
TableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), tableDefinition);
Table createdTable = bigquery.create(tableInfo);
assertNotNull(createdTable);
for (int i = 0; i < 1001; i++) {
  try {
    Table updatedTable =
      bigquery.update(tableInfo.toBuilder().setDescription("newDescription").build());
    } catch (BigQueryException ex) {
    System.out.println("MESSAGE IS " + ex.getMessage());
    System.out.println("REASON IS " + ex.getReason());
    System.out.println("ERROR IS " + ex.getError());
    System.out.println("CODE IS " + ex.getCode());
    break;
  }
}

And I get the following output:

MESSAGE IS Exceeded rate limits: Your table exceeded quota for table.insert or table.update per table. For more information, see https://cloud.google.com/bigquery/troubleshooting-errors
REASON IS rateLimitExceeded
ERROR IS BigQueryError{reason=rateLimitExceeded, location=table.write, message=Exceeded rate limits: Your table exceeded quota for table.insert or table.update per table. For more information, see https://cloud.google.com/bigquery/troubleshooting-errors}
CODE IS 403

As you can see CODE is correctly populated.

@mtagle
Copy link
Author

mtagle commented Nov 11, 2016

I'm using 0.2.7, but I think you are correct. I had assumed the issue was with the code but it appears that I was actually making incorrect assumptions about what the reason would be. I'll close this ticket. Thank you for your help!

@mtagle mtagle closed this as completed Nov 11, 2016
github-actions bot pushed a commit that referenced this issue Jun 21, 2022
…onfig to v1.5.0 (#1391)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.4.0` -> `1.5.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.0/compatibility-slim/1.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.0/confidence-slim/1.4.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerydatatransfer).
github-actions bot pushed a commit to yoshi-code-bot/google-cloud-java that referenced this issue Oct 6, 2022
… to v1.5.6 (googleapis#1391)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-resourcemanager](https://togithub.com/googleapis/java-resourcemanager) | `1.5.5` -> `1.5.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-resourcemanager/1.5.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-resourcemanager/1.5.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-resourcemanager/1.5.6/compatibility-slim/1.5.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-resourcemanager/1.5.6/confidence-slim/1.5.5)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMTYuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIxNi4wIn0=-->
github-actions bot pushed a commit to renovate-bot/google-cloud-java that referenced this issue Oct 8, 2022
🤖 I have created a release *beep* *boop*
---


## [3.7.1](https://togithub.com/googleapis/java-asset/compare/v3.7.0...v3.7.1) (2022-10-07)


### Dependencies

* Update dependency com.google.api.grpc:proto-google-cloud-orgpolicy-v1 to v2.3.6 ([googleapis#1390](https://togithub.com/googleapis/java-asset/issues/1390)) ([4219b66](https://togithub.com/googleapis/java-asset/commit/4219b66da58325f5a133caa84243dc0958d90149))
* Update dependency com.google.api.grpc:proto-google-cloud-os-config-v1 to v2.5.6 ([googleapis#1382](https://togithub.com/googleapis/java-asset/issues/1382)) ([3abde9e](https://togithub.com/googleapis/java-asset/commit/3abde9e4130d62d9e6857dd3b016be88691bd7f4))
* Update dependency com.google.api.grpc:proto-google-cloud-pubsub-v1 to v1.102.20 ([googleapis#1384](https://togithub.com/googleapis/java-asset/issues/1384)) ([5904111](https://togithub.com/googleapis/java-asset/commit/5904111205fc7c698703eb8db805b159a6513389))
* Update dependency com.google.api.grpc:proto-google-identity-accesscontextmanager-v1 to v1.4.5 ([googleapis#1383](https://togithub.com/googleapis/java-asset/issues/1383)) ([48f2dd8](https://togithub.com/googleapis/java-asset/commit/48f2dd863c23ec3fffb24970046cab6795a64045))
* Update dependency com.google.cloud:google-cloud-bigquery to v2.17.0 ([googleapis#1386](https://togithub.com/googleapis/java-asset/issues/1386)) ([d3cf534](https://togithub.com/googleapis/java-asset/commit/d3cf534180a8b0c4a421ff52a998b43edd502e6c))
* Update dependency com.google.cloud:google-cloud-core to v2.8.20 ([googleapis#1380](https://togithub.com/googleapis/java-asset/issues/1380)) ([113b74e](https://togithub.com/googleapis/java-asset/commit/113b74e29f05047ba3eb22cee370b2b35b133991))
* Update dependency com.google.cloud:google-cloud-pubsub to v1.120.20 ([googleapis#1385](https://togithub.com/googleapis/java-asset/issues/1385)) ([792d9a2](https://togithub.com/googleapis/java-asset/commit/792d9a2aa2253e4cb6541c587810aab936aa9d81))
* Update dependency com.google.cloud:google-cloud-resourcemanager to v1.5.6 ([googleapis#1391](https://togithub.com/googleapis/java-asset/issues/1391)) ([9afc924](https://togithub.com/googleapis/java-asset/commit/9afc924fbe87b481dc3b731935d3dc021e1bae00))
* Update dependency com.google.cloud:google-cloud-storage to v2.13.0 ([googleapis#1392](https://togithub.com/googleapis/java-asset/issues/1392)) ([9660ee4](https://togithub.com/googleapis/java-asset/commit/9660ee42c68e7cb88e0d6867ac46f2cd6056ca17))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants