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

Security plugin build fails on 1.x branch #762

Closed
cliu123 opened this issue May 21, 2021 · 7 comments
Closed

Security plugin build fails on 1.x branch #762

cliu123 opened this issue May 21, 2021 · 7 comments

Comments

@cliu123
Copy link
Member

cliu123 commented May 21, 2021

The CI on security repo main branch checkes out OpenSearch branch 1.x and build OpenSearch without build.version_qualifier as you can see here. But building security plugin fails because of the following error:

2021-05-21T20:39:19.2132668Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project opensearch-security: Compilation failure: Compilation failure: 
2021-05-21T20:39:19.2136247Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[51,85] no suitable method found for groupSetting(java.lang.String,org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2140753Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2147207Z [ERROR]       (varargs mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2155890Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,java.util.function.Consumer<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2163854Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to java.util.function.Consumer<org.opensearch.common.settings.Settings>)
2021-05-21T20:39:19.2177629Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[59,78] no suitable method found for intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,org.opensearch.common.settings.Setting.Property,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2185540Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2188457Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2191261Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2194065Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2197451Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,org.opensearch.common.settings.Setting.Validator<java.lang.Integer>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2200853Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2204123Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2207253Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2210459Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2213654Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2218695Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,org.opensearch.common.settings.Setting.Validator<java.lang.Integer>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2222453Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2225220Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2227918Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2231017Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[66,93] no suitable method found for groupSetting(java.lang.String,org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2235195Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2238639Z [ERROR]       (varargs mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2242817Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,java.util.function.Consumer<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2246886Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to java.util.function.Consumer<org.opensearch.common.settings.Settings>)
2021-05-21T20:39:19.2250849Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[72,81] no suitable method found for groupSetting(java.lang.String,org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2255027Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2258545Z [ERROR]       (varargs mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2262418Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,java.util.function.Consumer<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2266318Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to java.util.function.Consumer<org.opensearch.common.settings.Settings>)
2021-05-21T20:39:19.2270361Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[73,84] no suitable method found for groupSetting(java.lang.String,org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2274541Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2278248Z [ERROR]       (varargs mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2337476Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,java.util.function.Consumer<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2341464Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to java.util.function.Consumer<org.opensearch.common.settings.Settings>)
2021-05-21T20:39:19.2346567Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[74,82] no suitable method found for intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,org.opensearch.common.settings.Setting.Property,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2352159Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2355090Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2357940Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2380488Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2383916Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,org.opensearch.common.settings.Setting.Validator<java.lang.Integer>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2387608Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2390903Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2394025Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2405263Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2408537Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2412292Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,org.opensearch.common.settings.Setting.Validator<java.lang.Integer>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2416303Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2419071Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2421943Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2426156Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[75,91] no suitable method found for intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,org.opensearch.common.settings.Setting.Property,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2431735Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2434649Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2437449Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2440234Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2443644Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,int,org.opensearch.common.settings.Setting.Validator<java.lang.Integer>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2447071Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2450113Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2453224Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2456662Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2459852Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2465984Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,org.opensearch.common.settings.Setting<java.lang.Integer>,int,org.opensearch.common.settings.Setting.Validator<java.lang.Integer>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2469907Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting.Property cannot be converted to int)
2021-05-21T20:39:19.2472675Z [ERROR]     method org.opensearch.common.settings.Setting.intSetting(java.lang.String,int,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2475361Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<java.lang.Integer> cannot be converted to int)
2021-05-21T20:39:19.2478472Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/support/SecuritySettings.java:[127,88] no suitable method found for groupSetting(java.lang.String,org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2484370Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2487826Z [ERROR]       (varargs mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to org.opensearch.common.settings.Setting.Property)
2021-05-21T20:39:19.2491696Z [ERROR]     method org.opensearch.common.settings.Setting.groupSetting(java.lang.String,java.util.function.Consumer<org.opensearch.common.settings.Settings>,org.opensearch.common.settings.Setting.Property...) is not applicable
2021-05-21T20:39:19.2495883Z [ERROR]       (argument mismatch; org.opensearch.common.settings.Setting<org.opensearch.common.settings.Settings> cannot be converted to java.util.function.Consumer<org.opensearch.common.settings.Settings>)
2021-05-21T20:39:19.2498716Z [ERROR] /home/runner/work/security/security/src/main/java/org/opensearch/security/ssl/util/SSLSecuritySettings.java:[93,192] incompatible types: org.opensearch.common.settings.Setting<java.lang.Long> cannot be converted to long

In order to building security plugin successfully, build.version_qualifier has to be set to beta1 as you can see at here. Setting build.version_qualifier to rc1 fails the CI too.

@dai-chen
Copy link

dai-chen commented May 21, 2021

Adding my observation: SQL/PPL build can pass using rc1 tag and rc1 qualifier: opensearch-project/sql#83. But 1.x branch + rc1 qualifier didn't work (1.x qualifier is invalid). Please advise what's the right combination.

@cliu123
Copy link
Member Author

cliu123 commented May 21, 2021

@dblock mentioned that plugins should build on top of 1.x branch instead of any tags(neither beta1 nor rc1). But like I mentioned above in the issue description, keeping 1.x ref and removing qualifier fails security plugin build too.

@dai-chen
Copy link

@dblock mentioned that plugins should build on top of 1.x branch instead of any tags(neither beta1 nor rc1). But like I mentioned above in the issue description. Keeping 1.x ref, removing qualifier fails security plugin build too.

Yes, just added my data point. I haven't figured out how to build against 1.x either.

@dblock
Copy link
Member

dblock commented May 21, 2021

I presume you're coming from opensearch-project/security#1176.

Here's what I tried:

testbox ~/source/opensearch-project/OpenSearch/upstream-opensearch (1.x)$ ./gradlew publishToMavenLocal -Dbuild.snapshot=false

testbox ~/source/opensearch-project/common-utils/common-utils-upstream (main)$ ./gradlew publishToMavenLocal -Dbuild.snapshot=false

testbox ~/source/opensearch-project/job-scheduler/upstream-job-scheduler (main)$  ./gradlew publishToMavenLocal -Dbuild.snapshot=false

testbox ~/source/opensearch-project/security/security-upstream (andy840314-settings-migration-to-opensearch)$ git checkout -b andy840314-settings-migration-to-opensearch main

testbox ~/source/opensearch-project/security/security-upstream (andy840314-settings-migration-to-opensearch)$ git pull https://github.com/andy840314/security.git settings-migration-to-opensearch

testbox ~/source/opensearch-project/security/security-upstream (andy840314-settings-migration-to-opensearch)$ mvn -B clean package -Padvanced -DskipTests

(reproduces this problem)

Since this error says that a constructor added in 1.x is missing, this couldn't be right. The constructor was clearly added in 1.x. I double checked that the missing constructor was in code, then started clean, locally, without anything in my local maven repo to avoid picking up something from beta1.

rm -rf ~/.m2

Then:

testbox ~/source/opensearch-project/OpenSearch/upstream-opensearch (1.x)$ ./gradlew publishToMavenLocal -Dbuild.snapshot=false -Dbuild.version_qualifier=rc1

testbox ~/source/opensearch-project/common-utils/common-utils-upstream (main)$ ./gradlew publishToMavenLocal -Dbuild.snapshot=false -Dopensearch.version=1.0.0-rc1

testbox ~/source/opensearch-project/job-scheduler/upstream-job-scheduler (main)$  ./gradlew publishToMavenLocal -Dbuild.snapshot=false -Dopensearch.version=1.0.0-rc1

testbox ~/source/opensearch-project/security/security-upstream (andy840314-settings-migration-to-opensearch)$ git checkout -b andy840314-settings-migration-to-opensearch main

testbox ~/source/opensearch-project/security/security-upstream (andy840314-settings-migration-to-opensearch)$ git pull https://github.com/andy840314/security.git settings-migration-to-opensearch

# modify everything in security from beta1 to rc1, especially <opensearch.version>1.0.0-rc1</opensearch.version> to pickup the right dependency

testbox ~/source/opensearch-project/security/security-upstream (andy840314-settings-migration-to-opensearch)$ mvn -B clean package -Padvanced -DskipTests

This built successfully.

Make the above changes in your PR, make sure to change your dependency from opensearch beta1 to rc1, and you should be good to go!

@dblock
Copy link
Member

dblock commented May 22, 2021

Closing since this is entirely fixable in plugins, and fixed here in security plugin.

@dblock dblock closed this as completed May 22, 2021
@vrozov
Copy link
Contributor

vrozov commented May 22, 2021

@dblock @nknize @CEHENKLE @camerski While the issue was caused by incomplete changes in opensearch-project/security#1174, it highlights that the current approach of building Opensearch artifacts in plugins CI is error prone and does not follow open source best practices. What is the plan to remove CI hack and publish Opensearch artifacts to maven repo?

@dblock
Copy link
Member

dblock commented May 23, 2021

@dblock @nknize @CEHENKLE @camerski While the issue was caused by incomplete changes in opensearch-project/security#1174, it highlights that the current approach of building Opensearch artifacts in plugins CI is error prone and does not follow open source best practices. What is the plan to remove CI hack and publish Opensearch artifacts to maven repo?

See opensearch-project/opensearch-build#20.

ritty27 pushed a commit to ritty27/OpenSearch that referenced this issue May 12, 2024
…rch-project#762)

* Bump io.github.classgraph:classgraph from 4.8.164 to 4.8.165

Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.164 to 4.8.165.
- [Release notes](https://github.com/classgraph/classgraph/releases)
- [Commits](classgraph/classgraph@classgraph-4.8.164...classgraph-4.8.165)

---
updated-dependencies:
- dependency-name: io.github.classgraph:classgraph
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update changelog

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants