Open uwehdaub opened 3 weeks ago
I have the same problem
TASK [ansible-ThoTeam.nexus3-oss : Calling Groovy script create_blobstores_from_list] ********************************************************************************************************
fatal: [ubuntu]: FAILED! => {"changed": false, "connection": "close", "content_length": "278", "content_type": "application/json", "date": "Mon, 07 Oct 2024 21:02:25 GMT", "elapsed": 0, "failed_when_result": true, "json": {"name": "create_blobstores_from_list", "result": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl.getBlobStoreManager() is applicable for argument types: () values: []"}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "server": "Nexus/3.72.0-04 (OSS)", "status": 400, "url": "http://localhost:8081/service/rest/v1/script/create_blobstores_from_list/run", "x_content_type_options": "nosniff"}
fatal: [debian]: FAILED! => {"changed": false, "connection": "close", "content_length": "278", "content_type": "application/json", "date": "Mon, 07 Oct 2024 21:02:26 GMT", "elapsed": 1, "failed_when_result": true, "json": {"name": "create_blobstores_from_list", "result": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl.getBlobStoreManager() is applicable for argument types: () values: []"}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "server": "Nexus/3.72.0-04 (OSS)", "status": 400, "url": "http://localhost:8081/service/rest/v1/script/create_blobstores_from_list/run", "x_content_type_options": "nosniff"}
fatal: [rockylinux]: FAILED! => {"changed": false, "connection": "close", "content_length": "278", "content_type": "application/json", "date": "Mon, 07 Oct 2024 21:02:26 GMT", "elapsed": 1, "failed_when_result": true, "json": {"name": "create_blobstores_from_list", "result": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl.getBlobStoreManager() is applicable for argument types: () values: []"}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request", "redirected": false, "server": "Nexus/3.72.0-04 (OSS)", "status": 400, "url": "http://localhost:8081/service/rest/v1/script/create_blobstores_from_list/run", "x_content_type_options": "nosniff"}
TASK [ansible-ThoTeam.nexus3-oss : Debug script result for global fail] **********************************************************************************************************************
skipping: [debian]
skipping: [rockylinux]
skipping: [ubuntu]
TASK [ansible-ThoTeam.nexus3-oss : Global script failure at nexus level] *********************************************************************************************************************
skipping: [debian]
skipping: [ubuntu]
skipping: [rockylinux]
TASK [ansible-ThoTeam.nexus3-oss : Debug script result for failed script actions] ************************************************************************************************************
ok: [debian] => {
"msg": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl.getBlobStoreManager() is applicable for argument types: () values: []"
}
ok: [ubuntu] => {
"msg": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl.getBlobStoreManager() is applicable for argument types: () values: []"
}
ok: [rockylinux] => {
"msg": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl.getBlobStoreManager() is applicable for argument types: () values: []"
}
TASK [ansible-ThoTeam.nexus3-oss : Script action failure] ************************************************************************************************************************************
fatal: [debian]: FAILED! => {"changed": false, "msg": "The script create_blobstores_from_list returned at least one of its actions has failed. See the debug message above for details"}
fatal: [ubuntu]: FAILED! => {"changed": false, "msg": "The script create_blobstores_from_list returned at least one of its actions has failed. See the debug message above for details"}
fatal: [rockylinux]: FAILED! => {"changed": false, "msg": "The script create_blobstores_from_list returned at least one of its actions has failed. See the debug message above for details"}
PLAY RECAP ***********************************************************************************************************************************************************************************
debian : ok=56 changed=1 unreachable=0 failed=1 skipped=44 rescued=1 ignored=0
rockylinux : ok=58 changed=1 unreachable=0 failed=1 skipped=42 rescued=1 ignored=0
ubuntu : ok=55 changed=1 unreachable=0 failed=1 skipped=44 rescued=1 ignored=0
I will provide a fix for this tomorrow. Thanks for reporting! Bumping into the same issue tho.
I could not find a good way to access the blobStoreManager and we do not use the actual Codebase. What worked for us, but what is really hacky is the folowing:
`
import org.sonatype.nexus.blobstore.api.BlobStoreManager
import java.lang.reflect.Field
// Hack to access BlobStore Manager, access was removed in Nexus 3.72 because Groovy implemetation was replaced by Java and the field was made private
Field privateField = blobStore.class.getDeclaredField("blobStoreManager")
privateField.setAccessible(true)
BlobStoreManager blobStoreManager = (BlobStoreManager)privateField.get(blobStore)
//... other Code
existingBlobStore = blobStoreManager.get("BlobStoreName")
`
See #432 for a better fix, since Sonatype officially does not support Groovy scripts anymore. Will add more automated molecules tests for this change later this week, but this should get you guys up & running with the latest version of Nexus Repository Manager.
During the update from Nexus 3.71.1 to 3.72.0 the role (v2.5.1) fails with the following error message:
The playbook was running on Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1060-gcp x86_64).
Ansible role v2.5.2 fails with the same error message.