-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DEADLINE_EXCEEDED when using Cloud Pub/Sub library from Compute Engine #1430
Comments
+1. I was the one who asked the question on Stack Overflow. In my case, the following simple code caused DEADLINE_EXCEEDED errors when run on a Compute Engine instance within the same project as the Pub/Sub topic I wanted to publish to:
I could communicate with Pub/Sub using google-api-services-pubsub library, or via gcloud from the command line on the instance. |
I intend on investigating but it will take a couple days due to other commitments. |
+1. Encountering this issue with any type of call made w/ the PubSub client. |
+1. We had to revert back to the API while waiting for a fix to this. |
+1 I'm trying to find why in the mean time, even if I have no clue. |
Investigating now. |
So far, not good. I tought maybe I was polling pubsub a bit to aggressively, but It works like a charm on my machine. Maybe a network issue of some sort in the way k8n nodes are configured ? |
I had the same DEADLINE_EXCEEDED problem (for any pubsub request) in my windows 7 laptop, in GCE the same application runs fine. I fixed my problem forcing the Netty version to the one expected by google-cloud 0.8.0 that is 4.1.3.Final. I can reproduce DEADLINE_EXCEEDED errors in google-cloud-examples forcing Netty version to 4.1.5.Final or 4.16.Final, look at the pom.xml |
interesting, I have indeed a version conflict with netty. I'll try to fix my version to 4.1.3. |
didn't seem to change anything on my side :( |
I was able to make a successful call to Pub/Sub from a docker image on GCE. Could someone who is still having a problem give their pom.xml (or build.gradle as the case may be)? |
Here you are. I tried de strip this files to the bare minimum. |
@BodySplash , starting with your build.gradle for your common jar, I added a simple file to call pubsub plus a dependency on com.github.jengelman.gradle.plugins:shadow:1.2.4 to create a fat jar, and it worked in a docker image on GCE. Could you provide a minimal Dockerfile too? Maybe something is different there. |
It is very simple for now, maybe the issue is in the way I use the new lib. Or maybe, since I cleaned up a little bit my build.gradles before posting them, it solved the issue. ENV destination /app |
@garrettjonesgoogle - i'm still encountering the DEADLINE blocker. could you share your test project so i can run it locally and see if its something w/ my setup, or a system-wide issue? |
Here is my test project: Notes:
|
I looked at your sample project quickly. Is setting project-id mandatory or is it just for local testing ? Anyway, I'll try to give it a try as soon as possible, thank you for sharing it. |
PubSub needs to get a project somehow - either explicitly or implicitly (I think there are environmental sources for project). My sample code does it explicitly. |
Ok I was finally abled to make my service work. Here is the catch : I was using java:8-jre-alpine as my base image (I like my images to be small). Looking at your own dockerfile, I saw you were installing manually a java 8 jdk on an ubuntu, that was really the last significant difference with my own setup. I can't really say where the problem come from though. Is it using a jre or using alpine ? And in any case why ? Alpine and K8S had their issues in the past. It would be a pitty not to be able to use a jre alpine as base image. |
We're also using jre-alpine, so guess there's a common denominator there. |
I played a little bit with different base images, it's really a matter of alpine vs debian/ubuntu. |
I tried alpine myself and duplicated the issue. I turned on FINE logging and this showed up, which is the root cause of the DEADLINE_EXCEEDED error:
|
Actually this is the more appropriate error:
|
I did some research, and it seems that there are missing C libraries in Alpine because Alpine attempts to be very minimal, so there are numerous cases of products that won't work on Alpine. The core issue I saw when trying it myself is that netty-tcnative needs glibc, but glibc is not available out of the box in Alpine. I think this is outside the scope of google-cloud-java, and is up to each person who wants to use Alpine to figure out how to pull in all of the right dependencies to satisfy the linker issues. |
Hum interesting question. I tend to agree with you, but in the other hand alpine is becoming the de-facto standard as base image in the docker world. I guess at very least it should be clearly documented somewhere. |
+1 Faced the same issue running the google cloud api java client on ubuntu. |
I am having this problem when running locally in my project.
Does anyone have any similar problem? |
@ricardoneves93 could you file a new issue? You might have a different root cause, and it would be easier to track it separately. |
Happening to me as well with google-cloud-speech v0.8.1-alpha and v0.8.0 on tomcat v8.5.8 on Ubuntu 16.04 64bit. |
While using in raspberry pi 3 model B with raspbian os grpc channel created and topic is also created but when trying to publish message DEADLINE_EXCEEDED Runtime exception occurs. |
Is there any update on this? With the popularity of Alpine, I have trouble believing support with simply be cut out |
Note added in README about non-support of Alpine in #1430 . @olivierboucher could you file a separate issue requesting support for Alpine? This particular issue has become a little messy. |
We are facing similar issues on version ( <spring-cloud-gcp.version>1.0.0.M3</spring-cloud-gcp.version>) . Is there a fix already available for this is any of the version ? |
…14.1 (#1430) [![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-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.13.4` -> `2.14.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/compatibility-slim/2.13.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/confidence-slim/2.13.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/java-bigquery</summary> ### [`v2.14.1`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2141-httpsgithubcomgoogleapisjava-bigquerycomparev2140v2141-2022-07-27) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.14.0...v2.14.1) ##### Dependencies - update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#​2183](https://togithub.com/googleapis/java-bigquery/issues/2183)) ([f8325cf](https://togithub.com/googleapis/java-bigquery/commit/f8325cff22af3f087b23d6376ab96e78648efd00)) ### [`v2.14.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2140-httpsgithubcomgoogleapisjava-bigquerycomparev2138v2140-2022-07-22) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.13.8...v2.14.0) ##### Features - Add decimal target type ([#​2166](https://togithub.com/googleapis/java-bigquery/issues/2166)) ([ebbd8f5](https://togithub.com/googleapis/java-bigquery/commit/ebbd8f52853d3c0ca918a47d826474cc5825a58a)) - **bigquery:** enable use of GEOGRAPHY query params ([#​2158](https://togithub.com/googleapis/java-bigquery/issues/2158)) ([b19ad76](https://togithub.com/googleapis/java-bigquery/commit/b19ad767a53a9bd5d14b4cb36716cbb1c7b44ed6)) ##### Bug Fixes - Add query dryRun logic to get the schema when null schema is returned from the backend ([#​2106](https://togithub.com/googleapis/java-bigquery/issues/2106)) ([c98d22b](https://togithub.com/googleapis/java-bigquery/commit/c98d22b2b4f45e20d7d0666c5342cdbfadd30bde)) - enable longpaths support for windows test ([#​1485](https://togithub.com/googleapis/java-bigquery/issues/1485)) ([#​2164](https://togithub.com/googleapis/java-bigquery/issues/2164)) ([e18b9f8](https://togithub.com/googleapis/java-bigquery/commit/e18b9f8b4d2f194577b1710ad64710fe0f3d88d9)) - **java:** make field accessible to address Java 17 issue with arrow ([#​2165](https://togithub.com/googleapis/java-bigquery/issues/2165)) ([d605b81](https://togithub.com/googleapis/java-bigquery/commit/d605b8149954e79c05461630915b674e11793889)) ##### Dependencies - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#​2160](https://togithub.com/googleapis/java-bigquery/issues/2160)) ([970135b](https://togithub.com/googleapis/java-bigquery/commit/970135bec33b831925476855da9a84c34311068d)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#​2161](https://togithub.com/googleapis/java-bigquery/issues/2161)) ([3507bf7](https://togithub.com/googleapis/java-bigquery/commit/3507bf7c9fc2aef299d06d9771cfcc06e3080b87)) ### [`v2.13.8`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2138-httpsgithubcomgoogleapisjava-bigquerycomparev2137v2138-2022-07-01) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.13.7...v2.13.8) ##### Dependencies - update dependency com.google.cloud:google-cloud-storage to v2.9.0 ([#​2149](https://togithub.com/googleapis/java-bigquery/issues/2149)) ([a07c714](https://togithub.com/googleapis/java-bigquery/commit/a07c714cb90c7ff62a43f7500abe8d54a5cd0936)) ### [`v2.13.7`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2137-httpsgithubcomgoogleapisjava-bigquerycomparev2136v2137-2022-06-29) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.13.6...v2.13.7) ##### Dependencies - update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.4 ([#​2140](https://togithub.com/googleapis/java-bigquery/issues/2140)) ([c7ef597](https://togithub.com/googleapis/java-bigquery/commit/c7ef597832505e6c05adb38ac1db5dd15e32d024)) ### [`v2.13.6`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2136-httpsgithubcomgoogleapisjava-bigquerycomparev2135v2136-2022-06-24) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.13.5...v2.13.6) ##### Dependencies - update dependency com.google.apis:google-api-services-bigquery to v2-rev20220611-1.32.1 ([#​2132](https://togithub.com/googleapis/java-bigquery/issues/2132)) ([bddefcf](https://togithub.com/googleapis/java-bigquery/commit/bddefcf647d50ee12fffea80c04613b38b8d02d0)) - update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.3 ([#​2135](https://togithub.com/googleapis/java-bigquery/issues/2135)) ([0bd5ddc](https://togithub.com/googleapis/java-bigquery/commit/0bd5ddc0df0a978692252e50c37c94f41a3c4e1d)) ### [`v2.13.5`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2135-httpsgithubcomgoogleapisjava-bigquerycomparev2134v2135-2022-06-23) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.13.4...v2.13.5) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#​2128](https://togithub.com/googleapis/java-bigquery/issues/2128)) ([3043533](https://togithub.com/googleapis/java-bigquery/commit/3043533608c5659be0313f1942d20314d2157fd4)) </details> --- ### 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**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- 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). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMzUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEzNS4xIn0=-->
🤖 I have created a release *beep* *boop* --- ## [2.3.3](googleapis/java-bigquerydatatransfer@v2.3.2...v2.3.3) (2022-08-09) ### Dependencies * update dependency com.google.cloud:google-cloud-bigquery to v2.14.1 ([#1430](googleapis/java-bigquerydatatransfer#1430)) ([befed25](googleapis/java-bigquerydatatransfer@befed25)) * update dependency com.google.cloud:google-cloud-bigquery to v2.14.2 ([#1433](googleapis/java-bigquerydatatransfer#1433)) ([30b6942](googleapis/java-bigquerydatatransfer@30b6942)) * update dependency com.google.cloud:google-cloud-bigquery to v2.14.3 ([#1434](googleapis/java-bigquerydatatransfer#1434)) ([5c054b0](googleapis/java-bigquerydatatransfer@5c054b0)) * update dependency com.google.cloud:google-cloud-pubsub to v1.120.10 ([#1432](googleapis/java-bigquerydatatransfer#1432)) ([4ab39e9](googleapis/java-bigquerydatatransfer@4ab39e9)) * update dependency com.google.cloud:google-cloud-pubsub to v1.120.8 ([#1428](googleapis/java-bigquerydatatransfer#1428)) ([ddab51f](googleapis/java-bigquerydatatransfer@ddab51f)) * update dependency com.google.cloud:google-cloud-pubsub to v1.120.9 ([#1431](googleapis/java-bigquerydatatransfer#1431)) ([f909343](googleapis/java-bigquerydatatransfer@f909343)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1426](googleapis/java-bigquerydatatransfer#1426)) ([8a2c31e](googleapis/java-bigquerydatatransfer@8a2c31e)) * update dependency com.google.protobuf:protobuf-java-util to v3.21.3 ([#1423](googleapis/java-bigquerydatatransfer#1423)) ([50bc04e](googleapis/java-bigquerydatatransfer@50bc04e)) * update dependency com.google.protobuf:protobuf-java-util to v3.21.4 ([#1425](googleapis/java-bigquerydatatransfer#1425)) ([60d8c78](googleapis/java-bigquerydatatransfer@60d8c78)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
When using the Cloud Pub/Sub library in a Java application that has been deployed in a Google Compute Engine instance, a DEADLINE_EXCEEDED exception occurs. The application resides in a Docker container within a Container Engine-managed Compute Engine instance. The Pub/Sub topic and the Compute Engine instance are in the same project.
The Compute Engine service account has project editor permissions.
No problems with the old google-api-services-pubsub library.
The code to create the instance looks like this:
Then doing something like this (or alternatively, create a topic):
results in the following:
Versions:
I also found this issue at Stackoverflow
The text was updated successfully, but these errors were encountered: