-
Notifications
You must be signed in to change notification settings - Fork 209
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
Ansible role is failing during update from Nexus 3.71.1-06 to 3.72.0-04 #431
Comments
I have the same problem
|
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.
|
See #432 for a better fix, since Sonatype officially does not support Groovy scripts anymore. |
@Koeppchen Beautifully hacky. Works great - here's my diff for reference --- files/groovy/create_blobstores_from_list.groovy.orig 2024-11-21 17:40:45.984749159 +0000
+++ files/groovy/create_blobstores_from_list.groovy 2024-11-21 17:39:37.285848807 +0000
@@ -1,6 +1,14 @@
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
+// 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
+import org.sonatype.nexus.blobstore.api.BlobStoreManager
+import java.lang.reflect.Field
+
+Field privateField = blobStore.class.getDeclaredField("blobStoreManager")
+privateField.setAccessible(true)
+BlobStoreManager blobStoreManager = (BlobStoreManager)privateField.get(blobStore)
+
parsed_args = new JsonSlurper().parseText(args)
List<Map<String, String>> actionDetails = []
@@ -11,7 +19,8 @@
Map<String, String> currentResult = [name: blobstoreDef.name, type: blobstoreDef.get('type', 'file')]
- existingBlobStore = blobStore.getBlobStoreManager().get(blobstoreDef.name)
+ //existingBlobStore = blobStore.getBlobStoreManager().get(blobstoreDef.name)
+ existingBlobStore = blobStoreManager.get(blobstoreDef.name)
if (existingBlobStore == null) {
try {
if (blobstoreDef.type == "S3") { (@brianveltman's change may well be the better fix, but I have no idea where it is in that massive diff of changes) |
@LordAro I don't think I'd have found that hack alone ! Kudos ! One of my team mate was actively waiting for this. Cheers. I'm going to merge this ASAP. |
I have actively worked on a fork of this repo over the last year since I needed to move forward for a project im working on together with the support of Sonatype. A lot of issues and PR's addressed in this repository have been either merged, fixed or incorporated in a different way into my fork. Issues fixed: #289 #335 #408 #410 #427 #431 #433 #434 I've also been actively working on a new Ansible collection for Nexus3 that has more smaller roles that strictly make a distinction between provisioning tasks (i.e changing, updating, deleting infrastructural parts before installing Nexus) and configuration tasks (i.e everything done after a Nexus install) The configuration tasks in this new role is using API endpoints only, this way we're sure Nexus wont be restarted when a configuration item is processed and it doesn't rely on groovy/java classes anymore. This way the role can be used with any Nexus instance on VMs, bare metal, containers, clusters, HA setup etc.. Also an important note: this new role strictly enforces 'desired-state-config' principles. Meaning any configuration (including repositories) that's not defined in the Ansible variables will be deleted or set to the Nexus default where applicable. A lot of API endpoints associated with configuring Nexus are supported in this new role, except for:
Planned early 2025:
|
The collection has been published at Galaxy; https://galaxy.ansible.com/ui/repo/published/cloudkrafter/nexus/ and its repo can be found at: https://github.com/CloudKrafter/nexus-ansible-collection Updates since my last comment:
I'm working on a custom normalizing filter to handle the transformation of all repository definitions so the new role (config_api) will accept any What's planned for early 2025 has not been changed. |
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.
The text was updated successfully, but these errors were encountered: