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

[Bug]: LocalSpannerIO package namespace conflict with Beam's SpannerIO #1362

Closed
Abacn opened this issue Mar 13, 2024 · 4 comments
Closed

[Bug]: LocalSpannerIO package namespace conflict with Beam's SpannerIO #1362

Abacn opened this issue Mar 13, 2024 · 4 comments
Assignees
Labels
bug Something isn't working needs triage p2 stale

Comments

@Abacn
Copy link
Contributor

Abacn commented Mar 13, 2024

Related Template(s)

V1

Template Version

N/A

What happened?

V1 templates use LocalSpannerIO under Beam's namespace: https://github.com/GoogleCloudPlatform/DataflowTemplates/tree/main/v1/src/main/java/org/apache/beam/sdk/io/gcp/spanner and depends on beam-sdks-java-io-google-cloud-platform as well, causing unpredictable class conflict.

It happens in the 2.55.0 release validation: #1361 SpannerIO V1 templates failed with error

Caused by: java.lang.NoSuchMethodError: 'org.apache.beam.sdk.options.ValueProvider org.apache.beam.sdk.io.gcp.spanner.SpannerConfig.getCredentials()'
	at org.apache.beam.sdk.io.gcp.spanner.SpannerAccessor.buildSpannerOptions(SpannerAccessor.java:228)
	at org.apache.beam.sdk.io.gcp.spanner.SpannerAccessor.createAndConnect(SpannerAccessor.java:237)
	at org.apache.beam.sdk.io.gcp.spanner.SpannerAccessor.getOrCreate(SpannerAccessor.java:94)
	at org.apache.beam.sdk.io.gcp.spanner.LocalSpannerAccessor.getOrCreate(LocalSpannerAccessor.java:57)
	at com.google.cloud.teleport.templates.common.SpannerConverters$CreateTransactionFnWithTimestamp.setup(SpannerConverters.java:766

because SpannerAccessor was picked from beam-io-gcp but SpannerConfig was picked from v1 at run time, causing NoSuchMethodError.

We should either relocate the namespace of LocalSpannerIO or migrate to Beam's SpannerIO

Relevant log output

No response

@Abacn Abacn added bug Something isn't working p2 needs triage labels Mar 13, 2024
@Abacn Abacn self-assigned this Mar 13, 2024
@Abacn
Copy link
Contributor Author

Abacn commented Mar 13, 2024

Even removed duplicate classes and only preserve Localxxxx srcs, there are still test failing. Found that compilation of v1/ still generates many AUtoValue_* classes:

image

Also uploaded a reproduce at https://github.com/Abacn/codesnippets/tree/master/AutoValueTest , this might be an auto value bug

@Abacn
Copy link
Contributor Author

Abacn commented Mar 13, 2024

As a result we cannot partially remove the duplicated sources. We either need to keep sync with Beam or remove them altogether. entered autovalue bug google/auto#1734

Copy link

This issue has been marked as stale due to 180 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the issue at any time. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 10, 2024
Copy link

This issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

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

Successfully merging a pull request may close this issue.

1 participant