ort icon indicating copy to clipboard operation
ort copied to clipboard

config.yml is getting ignored while physically available

Open MNesche opened this issue 1 year ago • 24 comments

Describe the bug

Running ORT (any Version, starting from 28.0) in Jenkins on Windows, the config.yml (format previously to ORT Version 41.0.0) is physically present but will not be parsed further to be used for the execution. The default configuration settings are used instead. When implementing a false intendation in the config.yml, the ORT commands fail, due to the wrong intendation. This shows that the config.yml can be accessed and is also read by ORT.

Since ORT Version 41.0.0, the key "rootLicenseFilenames" in "licenseFilePatterns" of the config.yml got renamed. That should throw an error, cause the key is not valid anymore, if the same config is used with ORT 41.0.0. However, there is no error according the invalid key when running any ORT command, the fallback standard configuration settings are used instead.

To Reproduce

Steps to reproduce the behavior:

  1. Install ORT on Jenkins with the right Environment Variables
  2. Change specific values in the config.yml, i.e. limit the enabledPackageManagers
  3. Execute a command like "ort config --show-active"
  4. The content of the values are the standard values; in the example above, all possible PackageManagers are enabled.

Expected behavior

Settings in the config.yml will be applied successfully.

Console / log output

Add console and / or log output that shows the error and additional context. No screenshots of plain text please, to keep text searchable.

Output after using command "ort config --show-active":

c:\FileDir>"c:\jenkins-slave\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\ORT41\bin\ort.bat" --info config --show-active  
17:07:43.709 [main] INFO  org.ossreviewtoolkit.model.config.OrtConfiguration - Using ORT configuration file 'c:\FileDir\.ort\ort-config\config.yml'.
Hoplite is configured to infer which sealed type to choose by inspecting the config values at runtime. This behaviour is now deprecated in favour of explicitly specifying the type through a discriminator field. In 3.0 this new behavior will become the default. To enable this behavior now (and disable this warning), invoke withExplicitSealedTypes() on the ConfigLoaderBuilder.
17:07:44.455 [main] INFO  org.ossreviewtoolkit.utils.common.EnvironmentVariableFilter - EnvironmentVariableFilter initialized with denySubstrings = [key, pass, pwd, token, user] and allowNames = [CARGO_HTTP_USER_AGENT, COMPOSER_ALLOW_SUPERUSER, CONAN_LOGIN_ENCRYPTION_KEY, CONAN_LOGIN_USERNAME, CONAN_PASSWORD, CONAN_USERNAME, CONAN_USER_HOME, CONAN_USER_HOME_SHORT, DOTNET_CLI_CONTEXT_ANSI_PASS_THRU, GIT_ASKPASS, GIT_HTTP_USER_AGENT, GRADLE_USER_HOME, HACKAGE_USERNAME, HACKAGE_PASSWORD, HACKAGE_KEY, PWD, USER, USERPROFILE].
 ______________________________                                                
/        \_______   \__    ___/        The OSS Review Toolkit, version 41.0.0, 
|    |   | |       _/ |    |           built with JDK 21.0.5+11-LTS, running un
|    |   | |    |   \ |    |           Executing 'config' as 'ort-user' on 
\________/ |____|___/ |____|           with 4 CPUs and a maximum of 3066 MiB of
                                                                               
Environment variables:                                                        
ORT_CONFIG_DIR = c:\FileDir\.ort\ort-config  
ORT_DATA_DIR = c:\FileDir\.ort               
USERPROFILE = C:\Users\ort-user                                           
OS = Windows_NT                                                               
COMSPEC = C:\WINDOWS\system32\cmd.exe                                         
JAVA_HOME = c:\jenkins-slave\tools\hudson.model.JDK\java21_x86_64             
                                                                              
Looking for ORT configuration in the following file:
        c:\FileDir\.ort\ort-config\config.yml

The active configuration is:

ort:
  addAuthorsToCopyrights: false
  allowedProcessEnvironmentVariableNames:
  - "CARGO_HTTP_USER_AGENT"
  - "COMPOSER_ALLOW_SUPERUSER"
  - "CONAN_LOGIN_ENCRYPTION_KEY"
  - "CONAN_LOGIN_USERNAME"
  - "CONAN_PASSWORD"
  - "CONAN_USERNAME"
  - "CONAN_USER_HOME"
  - "CONAN_USER_HOME_SHORT"
  - "DOTNET_CLI_CONTEXT_ANSI_PASS_THRU"
  - "GIT_ASKPASS"
  - "GIT_HTTP_USER_AGENT"
  - "GRADLE_USER_HOME"
  - "HACKAGE_USERNAME"
  - "HACKAGE_PASSWORD"
  - "HACKAGE_KEY"
  - "PWD"
  - "USER"
  - "USERPROFILE"
  deniedProcessEnvironmentVariablesSubstrings:
  - "key"
  - "pass"
  - "pwd"
  - "token"
  - "user"
  enableRepositoryPackageConfigurations: false
  enableRepositoryPackageCurations: false
  forceOverwrite: false
  licenseFilePatterns:
    licenseFilenames:
    - "copying*"
    - "copyright"
    - "licence*"
    - "license*"
    - "*.licence"
    - "*.license"
    - "unlicence"
    - "unlicense"
    patentFilenames:
    - "patents"
    otherLicenseFilenames:
    - "readme*"
  packageConfigurationProviders:
  - type: "DefaultDir"
    id: "DefaultDir"
    enabled: true
    options: {}
  packageCurationProviders:
  - type: "DefaultDir"
    id: "DefaultDir"
    enabled: true
    options: {}
  - type: "DefaultFile"
    id: "DefaultFile"
    enabled: true
    options: {}
  severeIssueThreshold: "WARNING"
  severeRuleViolationThreshold: "WARNING"
  analyzer:
    allowDynamicVersions: false
    skipExcluded: false
  advisor:
    skipExcluded: false
  downloader:
    allowMovingRevisions: false
    includedLicenseCategories: []
    skipExcluded: false
    sourceCodeOrigins:
    - "VCS"
    - "ARTIFACT"
  scanner:
    skipConcluded: false
    skipExcluded: false
    detectedLicenseMapping:
      LicenseRef-scancode-agpl-generic-additional-terms: "NOASSERTION"
      LicenseRef-scancode-free-unknown: "NOASSERTION"
      LicenseRef-scancode-generic-cla: "NOASSERTION"
      LicenseRef-scancode-generic-exception: "NOASSERTION"
      LicenseRef-scancode-generic-export-compliance: "NOASSERTION"
      LicenseRef-scancode-generic-tos: "NOASSERTION"
      LicenseRef-scancode-generic-trademark: "NOASSERTION"
      LicenseRef-scancode-gpl-generic-additional-terms: "NOASSERTION"
      LicenseRef-scancode-other-copyleft: "NOASSERTION"
      LicenseRef-scancode-other-permissive: "NOASSERTION"
      LicenseRef-scancode-patent-disclaimer: "NOASSERTION"
      LicenseRef-scancode-unknown: "NOASSERTION"
      LicenseRef-scancode-unknown-license-reference: "NOASSERTION"
      LicenseRef-scancode-unknown-spdx: "NOASSERTION"
      LicenseRef-scancode-warranty-disclaimer: "NOASSERTION"
    ignorePatterns:
    - "**/*.ort.yml"
    - "**/*.spdx.yml"
    - "**/*.spdx.yaml"
    - "**/*.spdx.json"
    - "**/META-INF/DEPENDENCIES"
    - "**/META-INF/DEPENDENCIES.txt"
    - "**/META-INF/NOTICE"
    - "**/META-INF/NOTICE.txt"
  reporter: {}
  notifier:
    mail: null
    jira: null

Environment

Output of the ort requirements -l commands command:

 ______________________________                                                
/        \_______   \__    ___/        The OSS Review Toolkit, version 41.0.0, 
|    |   | |       _/ |    |           built with JDK 21.0.5+11-LTS, running un
|    |   | |    |   \ |    |           Executing 'requirements' as 'exam-servic
\________/ |____|___/ |____|           with 4 CPUs and a maximum of 3066 MiB of
                                                                               
Environment variables:                                                        
ORT_CONFIG_DIR = c:\FileDir\.ort\ort-config  
ORT_DATA_DIR = c:\FileDir\.ort               
USERPROFILE = C:\Users\ort-user                                           
OS = Windows_NT                                                               
COMSPEC = C:\WINDOWS\system32\cmd.exe                                         
JAVA_HOME = c:\jenkins-slave\tools\hudson.model.JDK\java21_x86_64             

Or manually specify:

  • ORT version: [e.g. 22.1.0]
  • Java version: [e.g. 17]
  • OS: [e.g. Linux]

And specify (relevant parts of) your ORT configuration (config.yml):

ort:
  allowedProcessEnvironmentVariableNames:
    - PASSPORT
    - USER_HOME
  deniedProcessEnvironmentVariablesSubstrings:
    - PASS
    - SECRET
    - TOKEN
    - USER

  enableRepositoryPackageConfigurations: true
  enableRepositoryPackageCurations: true

  # Force overwriting of any existing output files.
  forceOverwrite: true

  licenseFilePatterns:
    licenseFilenames: ['license*']
    patentFilenames: ['patents']
    rootLicenseFilenames: ['readme*']

Additional context

Further investigation assumes a problem in the hoplite library. The corresponding line of the issue happening in the source code of ORT seems to be at: https://github.com/oss-review-toolkit/ort/blob/1d5676fb98b833b0382c4be57d66d41355ad65e0/model/src/main/kotlin/config/OrtConfiguration.kt#L173

MNesche avatar Nov 22 '24 13:11 MNesche

Looks like there's a subtle issue with indentation of YAML lists: The "-" for the item must be on the start column of the parent key. This works for me:

ort:
  allowedProcessEnvironmentVariableNames:
  - PASSPORT
  - USER_HOME
  deniedProcessEnvironmentVariablesSubstrings:
  - PASS
  - SECRET
  - TOKEN
  - USER

  enableRepositoryPackageConfigurations: true
  enableRepositoryPackageCurations: true

  # Force overwriting of any existing output files.
  forceOverwrite: true

  licenseFilePatterns:
    licenseFilenames: ['license*']
    patentFilenames: ['patents']
    otherLicenseFilenames: ['readme*']

sschuberth avatar Nov 22 '24 16:11 sschuberth

Very weird, I was able to reproduce it once, but now not anymore...

sschuberth avatar Nov 22 '24 17:11 sschuberth

Hi sschuberth, thank you for having a look into this issue. The intendation is exactly as in https://github.com/oss-review-toolkit/ort/blob/ac270d80a8f882ba2869b0623202ec78a90b56bd/model/src/main/resources/reference.yml#L21-L29

However, changing the indendation didn't fix the problem, unfortunately. We copied the raw reference.yml from the ort repository, as available on github and used it as config, no chance, even that one gets ignored.

MNesche avatar Dec 04 '24 10:12 MNesche

I did another test and removed everything from the config.yml except:

ort:
  enableRepositoryPackageConfigurations: true
  enableRepositoryPackageCurations: true

Still it gets ignored, cause the output of the log is:

enableRepositoryPackageConfigurations: false
enableRepositoryPackageCurations: false

This is really odd.

MNesche avatar Dec 04 '24 15:12 MNesche

The intendation is exactly as in

Ok, that was a bit confusing. I've adressed that in https://github.com/oss-review-toolkit/ort/pull/9549.

sschuberth avatar Dec 05 '24 11:12 sschuberth

  1. Install ORT on Jenkins with the right Environment Variables

@MNesche, can you elaborate what you mean by "with the right Environment Variables"? Do you set environment variables that should influence ORT configuration?

sschuberth avatar Mar 25 '25 15:03 sschuberth

Yes, in Jenkins we used the Variables as described in https://oss-review-toolkit.org/ort/docs/getting-started/usage#configuration. Since that didn't work, we used the option "-c <pathToFile.yml>" but that didn't work also. With debugging, we noticed that the content of the file is passed to hoplite and the error happened probably in there.

MNesche avatar Mar 25 '25 15:03 MNesche

With the sentence "with the right Environment Variables" was only meant for the context of running ORT in Jenkins. It's not necessary to set environment variables in Jenkins for the directories, but since we did that, I mentioned it.

For the workaround, we use the mechanism you asked about, to parse the config as string to hoplite but not for overriding any configuration properties via environment variables. Here's the content of the patch:

Subject: [PATCH] ORT standalone version with included config settings as hardcoded string.
---
Index: helper-cli/src/main/kotlin/commands/CreateAnalyzerResultFromPackageListCommand.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/helper-cli/src/main/kotlin/commands/CreateAnalyzerResultFromPackageListCommand.kt b/helper-cli/src/main/kotlin/commands/CreateAnalyzerResultFromPackageListCommand.kt
--- a/helper-cli/src/main/kotlin/commands/CreateAnalyzerResultFromPackageListCommand.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/helper-cli/src/main/kotlin/commands/CreateAnalyzerResultFromPackageListCommand.kt	(date 1737550272238)
@@ -107,7 +107,8 @@
             )
         )
 
-        val ortConfig = OrtConfiguration.load(emptyMap(), configFile)
+        // previous: val ortConfig = OrtConfiguration.load(emptyMap(), configFile)
+        val ortConfig = OrtConfiguration.load()
         val packageCurationProviders = PackageCurationProviderFactory.create(ortConfig.packageCurationProviders)
 
         val ortResult = OrtResult(
Index: cli/src/main/kotlin/OrtMain.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/cli/src/main/kotlin/OrtMain.kt b/cli/src/main/kotlin/OrtMain.kt
--- a/cli/src/main/kotlin/OrtMain.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/cli/src/main/kotlin/OrtMain.kt	(date 1737540239023)
@@ -149,6 +149,7 @@
         // Make the parameter globally available.
         printStackTrace = stacktrace
 
+        /*
         // Make options available to subcommands and apply static configuration.
         val ortConfig = OrtConfiguration.load(args = configArguments, file = configFile)
         currentContext.findOrSetObject { ortConfig }
@@ -158,6 +159,19 @@
             ortConfig.deniedProcessEnvironmentVariablesSubstrings,
             ortConfig.allowedProcessEnvironmentVariableNames
         )
+        */
+
+    // Make options available to subcommands and apply static configuration. Hardcoded Config Variant
+        val ortConfig = OrtConfiguration.load()
+        currentContext.findOrSetObject { ortConfig }
+        LicenseFilePatterns.configure(ortConfig.licenseFilePatterns)
+
+        EnvironmentVariableFilter.reset(
+            ortConfig.deniedProcessEnvironmentVariablesSubstrings,
+            ortConfig.allowedProcessEnvironmentVariableNames
+        )
+
+
 
         if (helpAll) {
             registeredSubcommands().forEach {
Index: helper-cli/src/main/kotlin/commands/DownloadResultsFromPostgresCommand.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/helper-cli/src/main/kotlin/commands/DownloadResultsFromPostgresCommand.kt b/helper-cli/src/main/kotlin/commands/DownloadResultsFromPostgresCommand.kt
--- a/helper-cli/src/main/kotlin/commands/DownloadResultsFromPostgresCommand.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/helper-cli/src/main/kotlin/commands/DownloadResultsFromPostgresCommand.kt	(date 1737550249173)
@@ -145,7 +145,8 @@
     }
 
     private fun openDatabaseConnection(): Connection {
-        val storageConfig = OrtConfiguration.load(configArguments, configFile).scanner.storages?.values
+        // previous: OrtConfiguration.load(configArguments, configFile)
+        val storageConfig = OrtConfiguration.load().scanner.storages?.values
             ?.filterIsInstance<PostgresStorageConfiguration>()?.firstOrNull()
             ?: throw IllegalArgumentException("postgresStorage not configured.")
 
Index: model/src/main/kotlin/config/OrtConfiguration.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/model/src/main/kotlin/config/OrtConfiguration.kt b/model/src/main/kotlin/config/OrtConfiguration.kt
--- a/model/src/main/kotlin/config/OrtConfiguration.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/model/src/main/kotlin/config/OrtConfiguration.kt	(date 1737550315568)
@@ -20,10 +20,12 @@
 package org.ossreviewtoolkit.model.config
 
 import com.sksamuel.hoplite.ConfigLoaderBuilder
+import com.sksamuel.hoplite.ConfigSource
 import com.sksamuel.hoplite.PropertySource
 import com.sksamuel.hoplite.addEnvironmentSource
 import com.sksamuel.hoplite.fp.getOrElse
 import com.sksamuel.hoplite.resolver.context.ContextResolverMode
+import com.sksamuel.hoplite.yaml.YamlPropertySource
 
 import java.io.File
 
@@ -143,6 +145,7 @@
      */
     val notifier: NotifierConfiguration = NotifierConfiguration()
 ) {
+    /* original
     companion object {
         /**
          * Load the [OrtConfiguration]. The different sources are used with this priority:
@@ -185,6 +188,216 @@
                 OrtConfigurationWrapper(OrtConfiguration())
             }
 
+            return wrappedConfig.ort
+        }
+    }
+    */
+
+    /* added to use a hardcoded config */
+    companion object {
+         /**
+         * Load the [OrtConfiguration] using a hardcoded YAML configuration string.
+         */
+        fun load(): OrtConfiguration {
+            val hardcodedConfig = """
+ort:
+  allowedProcessEnvironmentVariableNames:
+    - PASSPORT
+    - USER_HOME
+  deniedProcessEnvironmentVariablesSubstrings:
+    - PASS
+    - SECRET
+    - TOKEN
+    - USER
+
+  enableRepositoryPackageConfigurations: true
+  enableRepositoryPackageCurations: true
+
+  # Force overwriting of any existing output files.
+  forceOverwrite: true
+
+  # add some more options here ....
+
+            """
+
+            val loader = ConfigLoaderBuilder.default()
+                .addSource(YamlPropertySource(hardcodedConfig))
+                .build()
+
+            val configResult = loader.loadConfig<OrtConfigurationWrapper>()
+            val wrappedConfig = configResult.getOrElse { failure ->
+                throw IllegalArgumentException("Failed to load ORT configuration: ${failure.description()}")
+            }
+
             return wrappedConfig.ort
         }
     }
Index: plugins/commands/config/src/main/kotlin/ConfigCommand.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/plugins/commands/config/src/main/kotlin/ConfigCommand.kt b/plugins/commands/config/src/main/kotlin/ConfigCommand.kt
--- a/plugins/commands/config/src/main/kotlin/ConfigCommand.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/plugins/commands/config/src/main/kotlin/ConfigCommand.kt	(date 1737550260062)
@@ -90,7 +90,8 @@
 
         checkSyntax?.run {
             runCatching {
-                OrtConfiguration.load(file = this)
+                // previous: OrtConfiguration.load(file = this)
+                OrtConfiguration.load()
             }.onSuccess {
                 echo("The syntax of the configuration file '$this' is valid.")
             }.onFailure {
Index: helper-cli/src/main/kotlin/commands/GetPackageLicensesCommand.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/helper-cli/src/main/kotlin/commands/GetPackageLicensesCommand.kt b/helper-cli/src/main/kotlin/commands/GetPackageLicensesCommand.kt
--- a/helper-cli/src/main/kotlin/commands/GetPackageLicensesCommand.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/helper-cli/src/main/kotlin/commands/GetPackageLicensesCommand.kt	(date 1737550239506)
@@ -106,7 +106,8 @@
     }
 
     private fun getStoredScanResults(pkg: Package): List<ScanResult> {
-        val ortConfiguration = OrtConfiguration.load(configArguments, configFile)
+        // previous: val ortConfiguration = OrtConfiguration.load(configArguments, configFile)
+        val ortConfiguration = OrtConfiguration.load()
         val scanStorages = ScanStorages.createFromConfig(ortConfiguration.scanner)
         return runCatching { scanStorages.read(pkg) }.getOrDefault(emptyList())
     }
Index: helper-cli/src/main/kotlin/commands/provenancestorage/DeleteCommand.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/helper-cli/src/main/kotlin/commands/provenancestorage/DeleteCommand.kt b/helper-cli/src/main/kotlin/commands/provenancestorage/DeleteCommand.kt
--- a/helper-cli/src/main/kotlin/commands/provenancestorage/DeleteCommand.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/helper-cli/src/main/kotlin/commands/provenancestorage/DeleteCommand.kt	(date 1737543893025)
@@ -67,7 +67,8 @@
     ).flag()
 
     override fun run() {
-        val config = OrtConfiguration.load(configArguments, configFile)
+        // val config = OrtConfiguration.load(configArguments, configFile)
+        val config = OrtConfiguration.load()
         val scanStorages = ScanStorages.createFromConfig(config.scanner)
 
         val provenances = scanStorages.packageProvenanceStorage.readProvenances(packageId)
Index: helper-cli/src/main/kotlin/commands/ListStoredScanResultsCommand.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/helper-cli/src/main/kotlin/commands/ListStoredScanResultsCommand.kt b/helper-cli/src/main/kotlin/commands/ListStoredScanResultsCommand.kt
--- a/helper-cli/src/main/kotlin/commands/ListStoredScanResultsCommand.kt	(revision b5cc0ea487a5151fa0d4830f94bb063f0d9bf520)
+++ b/helper-cli/src/main/kotlin/commands/ListStoredScanResultsCommand.kt	(date 1737543849891)
@@ -63,7 +63,8 @@
     ).associate()
 
     override fun run() {
-        val config = OrtConfiguration.load(configArguments, configFile)
+        // val config = OrtConfiguration.load(configArguments, configFile)
+        val config = OrtConfiguration.load()
         val scanStorages = ScanStorages.createFromConfig(config.scanner)
 
         println(

MNesche avatar Mar 26 '25 08:03 MNesche

@MNesche can you try without your work-around but https://github.com/oss-review-toolkit/ort/pull/10095 merged? Do you then get a proper error on your side, instead of the silent fallback to the default config?

sschuberth avatar Mar 26 '25 10:03 sschuberth

Sure, thanks a lot for the update and effort in finding a solution, I'll let you know about the result as soon as possible.

MNesche avatar Mar 26 '25 10:03 MNesche

@sschuberth, the results are as following: This works: Implemented fix according to @Harshad_Sinkar with commenting out // .addEnvironmentSource() in model/src/main/kotlin/config/OrtConfiguration.kt.

Config is used, as seen in the output log:

13:36:40  The following 2 package manager(s) are enabled:
13:36:40          Maven, NPM
13:36:41  The following 2 package curation provider(s) are enabled:
13:36:41          RepositoryConfiguration, ort-config-curations

The merge of the commits into the master branch according to https://github.com/oss-review-toolkit/ort/pull/10095 doesn't work. There's no error message or output according the problem. Config is not used, as seen in the output log:

14:06:00  The following 26 package manager(s) are enabled:
14:06:00          Bazel, Bower, Bundler, Cargo, Carthage, CocoaPods, Composer, Conan, GoMod, Gradle Inspector, Maven, NPM, NuGet, PIP, Pipenv, PNPM, Poetry, Pub, SBT, SpdxDocumentFile, Stack, Swift Package Manager, Tycho, Unmanaged, Yarn, Yarn 2+
14:06:01  The following 2 package curation provider(s) are enabled:
14:06:01          DefaultDir, DefaultFile

The same config has been used for both tests, without any changes in between. The test runs were on Jenkins, running on Windows, same pipeline, only the ORT files have been exchanged. Hope that helps.

MNesche avatar Mar 26 '25 13:03 MNesche

@sinkarharshad and others, could you try with https://github.com/oss-review-toolkit/ort/pull/10106? Is the issue then still reproducible?

sschuberth avatar Mar 27 '25 12:03 sschuberth

@sschuberth I tried with #10106 and was able to reproduce the issue. I didn’t notice anything in the log, but I might have missed something:

❯ $ORT --debug -c dir_zlib_ort_results/config.yml config --show-active                                                                                         ─╯
14:04:15.182 [main] INFO  org.ossreviewtoolkit.model.config.OrtConfiguration - Using ORT configuration file '/Users/harshadsinkar/devel/dir_ort_test/dir_zlib_ort_results/config.yml'.
Hoplite is configured to infer which sealed type to choose by inspecting the config values at runtime. This behaviour is now deprecated in favour of explicitly specifying the type through a discriminator field. In 3.0 this new behavior will become the default. To enable this behavior now (and disable this warning), invoke withExplicitSealedTypes() on the ConfigLoaderBuilder.
14:04:15.321 [main] INFO  org.ossreviewtoolkit.utils.common.EnvironmentVariableFilter - EnvironmentVariableFilter initialized with denySubstrings = [key, pass, pwd, token, user] and allowNames = [CARGO_HTTP_USER_AGENT, COMPOSER_ALLOW_SUPERUSER, CONAN_LOGIN_ENCRYPTION_KEY, CONAN_LOGIN_USERNAME, CONAN_PASSWORD, CONAN_USERNAME, CONAN_USER_HOME, CONAN_USER_HOME_SHORT, DOTNET_CLI_CONTEXT_ANSI_PASS_THRU, GIT_ASKPASS, GIT_HTTP_USER_AGENT, GRADLE_USER_HOME, HACKAGE_USERNAME, HACKAGE_PASSWORD, HACKAGE_KEY, PWD, USER, USERPROFILE].

sinkarharshad avatar Mar 27 '25 13:03 sinkarharshad

Thanks @sinkarharshad for trying! Do you see the new "All property sources were empty, falling back to the default configuration." log statement in the output?

sschuberth avatar Mar 27 '25 15:03 sschuberth

@sschuberth Nope, could not find any trace of that in the log. Attaching here the full log for your reference.

config_log.txt

sinkarharshad avatar Mar 27 '25 16:03 sinkarharshad

If you don't have any sensitive information in there, could you also dump all your environment variables?

sschuberth avatar Mar 27 '25 18:03 sschuberth

Here you go: env.txt

sinkarharshad avatar Mar 27 '25 18:03 sinkarharshad

Is this issue still reproducible by anyone with latest ORT?

sschuberth avatar Jun 16 '25 07:06 sschuberth

Hi @sschuberth , thanks a lot for coming back to this topic. We'll test it and I'll let you know about the outcome as soon as possible. Kind regards.

Outcome: After running the test, it's the same as for @harshadsinkar, ORT version 61.0.0 still got the same issue when running in Jenkins.

MNesche avatar Jun 16 '25 09:06 MNesche

Hi @sschuberth, I tested it today on my machine (macOS) with ORT version 61.0.0 and can confirm the issue still persists at my end. If you need any further details, please let me know.

Thank you again for your attention to this issue.

harshadsinkar avatar Jun 16 '25 13:06 harshadsinkar

Thanks for the feedback @harshadsinkar! If you have a chance, could you try if the issue persists when changing the Hoplite version at

https://github.com/oss-review-toolkit/ort/blob/e2ee1a7bbedc5ad53b7be0279578c6aa48484c3d/gradle/libs.versions.toml#L33

to 3.0.0.RC1 and rebuilding / rerunning ORT?

sschuberth avatar Jun 16 '25 13:06 sschuberth

Hi @sschuberth, With the hoplite version 3.0.0.RC1, it picked up the correct ORT configuration file, and I could no longer reproduce the issue.

If I could help any further, do let me know and thanks again.

harshadsinkar avatar Jun 17 '25 05:06 harshadsinkar

Awesome, thanks for checking @harshadsinkar!

Unfortunately, it might us a while to upgrade to Hoplite 3.0.0 final (once it's there) due to this.

sschuberth avatar Jun 17 '25 06:06 sschuberth