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

Connection refused is coming when connecting to Bigquery Emulator on Windows and Docker env on local #365

Open
hardikbadjatiya opened this issue Nov 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hardikbadjatiya
Copy link

What happened?

Issue Coming on Windows and Docker local , But same code working on Mac when using big query emulator.

Library - "com.google.cloud:google-cloud-bigquery:2.42.3"

While writing the Data from CSV to bigquery using java code , It is giving error on windows and docker env. But it is working on mac.
Bigquery Object -
bigQuery = BigQueryOptions
.newBuilder()
.setHost(instanceAddress)
.setProjectId(bigQueryConfigProperties.projectId)
.setCredentials(NoCredentials.getInstance())
.build()
.service

Bigquery Writer-
WriteChannelConfiguration.newBuilder(tableId)
.setFormatOptions(FormatOptions.csv())
.setCreateSession(true)
.build()
writer.use {
it.write(ByteBuffer.wrap(ClassPathResource(csvPathString).getInputStream().readBytes()))
}

.BigQueryLocalDataLoader","timestamp":"2024-11-14T19:23:45.856Z"}
com.google.cloud.bigquery.BigQueryException: Connection refused
at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.translate(HttpBigQueryRpc.java:116)
at com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc.write(HttpBigQueryRpc.java:848)
at com.google.cloud.bigquery.TableDataWriteChannel$1.call(TableDataWriteChannel.java:59)
at com.google.cloud.bigquery.TableDataWriteChannel$1.call(TableDataWriteChannel.java:54)
at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:102)
at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
at com.google.cloud.bigquery.TableDataWriteChannel.flushBuffer(TableDataWriteChannel.java:53)
at com.google.cloud.BaseWriteChannel.close(BaseWriteChannel.java:151)

What did you expect to happen?

It should load the csv data in bigquery on each OS type and between docker env.

How can we reproduce it (as minimally and precisely as possible)?

using library and docker image of Bigquery ,
Please use windows or docker env code that connects to bigquery emulator and inserts dat It will not allow to connect to bigquery emulator on local . But same code works over MAC machines.

Anything else we need to know?

I feel like there is some hard coding done for mac machines.

@hardikbadjatiya hardikbadjatiya added the bug Something isn't working label Nov 14, 2024
@hardikbadjatiya
Copy link
Author

Hi Team,
needed your assistance on above issue , It is a major blocker for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant