Skip to content

[CI] CI breaks due to Strings.toString() signature change in OpenSearch #2417

@DarshitChanpura

Description

@DarshitChanpura

Security CI is broken due to a change introduced via PR opensearch-project/OpenSearch#6009

This PR introduces a change in method signature for toString() method in commons package: Strings.toString(ToXContent toXContent) to toString(MediaType mediaType, ToXContent toXContent)

Security's toString call : https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/configuration/ConfigurationRepository.java#:~:text=Strings,

OpenSearch's toString() implementation: https://github.com/opensearch-project/OpenSearch/blob/ee58457bd5a7313bab201edd38195902f859027c/server/src/main/java/org/opensearch/common/Strings.java#L715

Error details:
[2023-01-26T15:04:47,405][ERROR][o.o.b.OpenSearchUncaughtExceptionHandler] [3c06300b34da.ant.amazon.com] fatal error in thread [opensearch[3c06300b34da.ant.amazon.com][generic][T#5]], exiting
java.lang.NoSuchMethodError: 'java.lang.String org.opensearch.common.Strings.toString(org.opensearch.common.xcontent.ToXContent)'
	at org.opensearch.security.configuration.ConfigurationRepository.getConfigurationsFromIndex(ConfigurationRepository.java:382) ~[?:?]
	at org.opensearch.security.configuration.ConfigurationRepository.getConfigurationsFromIndex(ConfigurationRepository.java:346) ~[?:?]
	at org.opensearch.security.dlic.rest.api.AbstractApiAction.load(AbstractApiAction.java:247) ~[?:?]
	at org.opensearch.security.dlic.rest.api.SecurityConfigAction.handleGet(SecurityConfigAction.java:79) ~[?:?]
	at org.opensearch.security.dlic.rest.api.AbstractApiAction.handleApiRequest(AbstractApiAction.java:124) ~[?:?]
	at org.opensearch.security.dlic.rest.api.PatchableResourceApiAction.handleApiRequest(PatchableResourceApiAction.java:268) ~[?:?]
	at org.opensearch.security.dlic.rest.api.SecurityConfigAction.handleApiRequest(SecurityConfigAction.java:93) ~[?:?]
	at org.opensearch.security.dlic.rest.api.AbstractApiAction.lambda$prepareRequest$2(AbstractApiAction.java:401) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
	at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:747) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.lang.Thread.run(Thread.java:1589) [?:?]
fatal error in thread [opensearch[3c06300b34da.ant.amazon.com][generic][T#5]], exiting

Solution:
Modify toString() to reflect correct signature

Metadata

Metadata

Labels

bugSomething isn't workingciuntriagedRequire the attention of the repository maintainers and may need to be prioritized

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions