vmware / build-tools-for-vmware-aria

Build Tools for VMware Aria provides development and release management tools for implementing automation solutions based on the VMware Aria Suite and VMware Cloud Director. The solution enables Virtual Infrastructure Administrators and Automation Developers to use standard DevOps practices for managing and deploying content.
Other
48 stars 24 forks source link

Configuration Element SecureString Issue #398

Closed unbreakabl3 closed 2 months ago

unbreakabl3 commented 3 months ago

Description

When trying to attribute of type "SecureString”, I am getting a build error. Without "SecureString”, all is working with all other types. I am not sure what is wrong, but it did work before. I did try it with older versions. The problem is the same.

If I run a build a few times, one of them will pass, GUI will return Error 500.

Steps to Reproduce

  1. Create a configuration element file
  2. Create an attribute of type "SecureString"
  3. Run mvn -T 10C install vrealize:push -P ...

Preconditions: [What are the preconditions to reproduce the issue]

Expected behavior: [What you expect to happen]

A configuration element with a secure attribute will be created.

Actual behavior: [What actually happens]

Build is failing.

Reproduces how often: [What percentage of the time does it reproduce] 90%

Component/s: [What are the Build Tools for VMware Aria components affected by the issue (e.g. "common/artifact-manager", "maven/plugins/vra-ng", "typescript/vrotest", etc)]

com.vmware.pscoe.maven.plugins:vrealize-package-maven-plugin:2.41.0:push

Affects Build/s: [Which are the Build Tools for VMware Aria releases / builds affected by the issue] 2.41.0, 2.40.0, 2.39.0...

Environment

Client

Server

Failure Logs

Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts
[INFO] Authentication strategy: 'VRA'
[INFO] Detecting vRO Server version '8.16.1.23313062'.
[INFO] Merge Package vrealize PushMojo: false
[INFO] Start executing import all packages...
[INFO] STRATEGY| INFO | Apply Configuration strategies for import
[INFO] STRATEGY| PASS | Source.Version > Destination.Version
[INFO] PACKAGE | SKIP | com.vmware.pscoe.library.ecmascript (2.41.0) > (2.41.0)
[INFO] PACKAGE | PASS | com.clouddepth (1.0.14) > (1.0.13)
[INFO] Package | IMPORT | com.clouddepth-1.0.14.package
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.664 s (Wall Clock)
[INFO] Finished at: 2024-08-28T16:08:03+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vmware.pscoe.maven.plugins:vrealize-package-maven-plugin:2.41.0:push (default-cli) on project: Execution default-cli of goal com.vmware.pscoe.maven.plugins:vrealize-package-maven-plugin:2.41.0:push failed: Error during import of package com.clouddepth-1.0.14.package, REST API call Request was POST https://vra/vco/api/packages?overwrite=true&tagImportMode=ImportAndOverwriteExistingValue&importConfigurationAttributeValues=true&importConfigSecureStringAttributeValues=true
[ERROR] Content-Type: multipart/form-data
[ERROR] 
[ERROR] "<Multipart Form Data>"
[ERROR] 
[ERROR] And Caused Exception: 400 Invalid/Unreachable FQDN or IP address: 400 Bad Request
[ERROR] Cache-Control: no-cache, no-store, max-age=0, must-revalidate
[ERROR] Content-Type: application/json;v=5.1.1;charset=UTF-8
[ERROR] Date: Wed, 28 Aug 2024 14:08:02 GMT
[ERROR] Expires: 0
[ERROR] Pragma: no-cache
[ERROR] Strict-Transport-Security: max-age=31536000 ; includeSubDomains
[ERROR] Vary: Origin
[ERROR] Vary: Access-Control-Request-Method
[ERROR] Vary: Access-Control-Request-Headers
[ERROR] X-Content-Type-Options: nosniff
[ERROR] X-Frame-Options: DENY
[ERROR] X-Xss-Protection: 1; mode=block
[ERROR] Transfer-Encoding: chunked
[ERROR] 
[ERROR] {"status":400,"message":"java.lang.NullPointerException: Cannot invoke \"ch.dunes.model.dunes.IDunesObjectContentHolder.loadContent(ch.dunes.model.IObjectFactory)\" because \"databaseObject\" is null caused by: Cannot invoke \"ch.dunes.model.dunes.IDunesObjectContentHolder.loadContent(ch.dunes.model.IObjectFactory)\" because \"databaseObject\" is null"}
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

image

Related issues and PRs

Additional Context

VenelinBakalov commented 3 months ago

Interesting, what kind of project are you using, is it typescript? could you attach a sample content of a config element file? I could not reproduce this with typescript however, i saw some other interesting behaviour:

  1. SecureString defined as yaml works good image image
  2. SecureString set as json is translated to Any image image
unbreakabl3 commented 3 months ago

It is a TS project. Both are getting the same error.

image

image

unbreakabl3 commented 3 months ago

When its "half working", the configuration element folder is created, but its empty.

image

VenelinBakalov commented 3 months ago

Strange, I tested using the attribute, now it works with properly setting the type: image image

Let me ask another colleague to test and see if there are any diffs.

I am not sure if it is possible that the diff comes from any environment config..here is what i am using: image

akantchev commented 3 months ago

Hi @unbreakabl3,

Thanks for the detailed explanation, I was unable to reproduce the issue with a typescript project with configuration element using the following environment configurations:

  1. OS: Windows 11, node: v22.3.0, java 21.0.4, maven: 3.9.7, vRO: 8.16.0.33697
  2. OS: Linux (Ubuntu). node: v22.4.1, java: 17.0.6, maven: 3.9.7, vRO: 8.16.0.33697

I suspect that there is something wrong with the target vRO server (product/environment issue) that is causing the problem, as the error is returned by the target vRO itself.

Michaelpalacce commented 2 months ago

As @akantchev says, seems like Aria Orchestrator is not in a good state. Can you try to remove the package and everything in it manually?

unbreakabl3 commented 2 months ago

Did it. Looks ok now. Thanks.