Sonar-Runner job can't write to G:\.sonar_lock (looks like cache dir to me) - sonar-runner

We installed a new SonarQube 5.2 instance with Sonar-Runner 2.4 and MSSqlServer with the sonar.jdbc.url=jdbc:jtds:sqlserver:... driver.
For some reason we can't identify where the .sonar_lock configuration is being written to by sonar-runner.bat analysis. There seems to be a permission error there somewhere and it may be because the task is running under a "bamboo" service account user. It could also be due to cached data somewhere (possibly) copied from a different server. Not sure. I can see where the lock is supposed to exist and we are trying to set
-Dsonar.working.directory=${bamboo.build.working.directory}/.sonar and
-Dsonar_user_home=${bamboo.build.working.directory}/../.sonar (trying to write it to a common directory at runtime, but the error is still showing up on attempting to write to "G:\" We don't want it to write to the root of the drive because there is bad juju relative to security policies on that location. And we can't see where that is set anyway.
Maven plugin jobs work fine, groovy plugin jobs work fine, this is just an issue using the sonar-runner.bat. I checked that .bat file and did a hard code of the "set SONAR_RUNNER_HOME=%~dp0.." to a location that wasn't the G: drive. but that is still giving us the error in the same location.
The error we are seeing is this:
build 04-Jan-2016 15:07:11 15:07:11.297 DEBUG - Publish global mode
build 04-Jan-2016 15:07:11 15:07:11.843 DEBUG - cache: C:\Users\XBBOSP000\.sonar\ws_cache\https%3A%2F%2Fsomewebsitesomewhere.net\global
build 04-Jan-2016 15:07:11 15:07:11.906 INFO - Load global repositories
build 04-Jan-2016 15:07:11 15:07:11.937 DEBUG - Download: https://somewebsitesomewhere.net/batch/global (no proxy)
build 04-Jan-2016 15:07:12 15:07:12.514 INFO - Load global repositories (done) | time=592ms
build 04-Jan-2016 15:07:12 15:07:12.842 WARN - Property 'sonar.jdbc.url' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.
build 04-Jan-2016 15:07:12 15:07:12.873 INFO - User cache: C:\Users\XBBOSP000\.sonar\cache
build 04-Jan-2016 15:07:14 15:07:14.152 INFO - Load plugins index
build 04-Jan-2016 15:07:14 15:07:14.152 DEBUG - Download: https://somewebsitesomewhere.net/deploy/plugins/index.txt (no proxy)
build 04-Jan-2016 15:07:14 15:07:14.214 INFO - Load plugins index (done) | time=62ms
build 04-Jan-2016 15:07:14 15:07:14.214 DEBUG - Load plugins
build 04-Jan-2016 15:07:15 15:07:15.806 DEBUG - Load plugins (done) | time=1592ms
build 04-Jan-2016 15:07:15 15:07:15.962 DEBUG - API compatibility mode is enabled on plugin JavaScript [javascript] (built with API lower than 5.2)
build 04-Jan-2016 15:07:15 15:07:15.962 DEBUG - API compatibility mode is enabled on plugin Findbugs [findbugs] (built with API lower than 5.2)
build 04-Jan-2016 15:07:15 15:07:15.977 DEBUG - API compatibility mode is enabled on plugin Groovy [groovy] (built with API lower than 5.2)
build 04-Jan-2016 15:07:15 15:07:15.993 DEBUG - API compatibility mode is enabled on plugin Web [web] (built with API lower than 5.2)
build 04-Jan-2016 15:07:15 15:07:15.993 DEBUG - API compatibility mode is enabled on plugin XML [xml] (built with API lower than 5.2)
build 04-Jan-2016 15:07:15 15:07:15.993 DEBUG - API compatibility mode is enabled on plugin Widget Lab [widgetlab] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.024 DEBUG - API compatibility mode is enabled on plugin Git [scmgit] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.024 DEBUG - API compatibility mode is enabled on plugin JIRA [jira] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.024 DEBUG - API compatibility mode is enabled on plugin Page Decoration [pagedecoration] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.040 DEBUG - API compatibility mode is enabled on plugin SVN [scmsvn] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.055 DEBUG - API compatibility mode is enabled on plugin PMD [pmd] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.071 DEBUG - API compatibility mode is enabled on plugin Java [java] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.071 DEBUG - API compatibility mode is enabled on plugin .NET [dotnet] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.086 DEBUG - API compatibility mode is enabled on plugin C# [csharp] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.118 DEBUG - API compatibility mode is enabled on plugin Crowd [crowd] (built with API lower than 5.2)
build 04-Jan-2016 15:07:16 15:07:16.118 DEBUG - API compatibility mode is enabled on plugin Cobertura [cobertura] (built with API lower than 5.2)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - Plugins:
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * JavaScript 2.8 (javascript)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Findbugs 3.3 (findbugs)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Groovy 1.3 (groovy)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Web 2.4 (web)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * XML 1.3 (xml)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Widget Lab 1.8.1 (widgetlab)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Git 1.0 (scmgit)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * JIRA 1.2 (jira)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Page Decoration 1.0.1 (pagedecoration)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * SVN 1.2 (scmsvn)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * PMD 2.5 (pmd)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Java 3.7.1 (java)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * .NET 2.1 (dotnet)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * C# 4.3 (csharp)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Crowd 2.0 (crowd)
build 04-Jan-2016 15:07:18 15:07:18.785 DEBUG - * Cobertura 1.6.3 (cobertura)
build 04-Jan-2016 15:07:19 15:07:19.659 INFO - Process project properties
build 04-Jan-2016 15:07:19 15:07:19.659 DEBUG - Process project properties (done) | time=0ms
build 04-Jan-2016 15:07:20 INFO: ------------------------------------------------------------------------
build 04-Jan-2016 15:07:20 INFO: EXECUTION FAILURE
build 04-Jan-2016 15:07:20 INFO: ------------------------------------------------------------------------
build 04-Jan-2016 15:07:20 Total time: 14.639s
build 04-Jan-2016 15:07:20 Final Memory: 8M/76M
build 04-Jan-2016 15:07:20 INFO: ------------------------------------------------------------------------
error 04-Jan-2016 15:07:20 ERROR: Error during Sonar runner execution
error 04-Jan-2016 15:07:20 org.sonar.runner.impl.RunnerException: Unable to execute Sonar
error 04-Jan-2016 15:07:20 at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
error 04-Jan-2016 15:07:20 at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
error 04-Jan-2016 15:07:20 at java.security.AccessController.doPrivileged(Native Method)
error 04-Jan-2016 15:07:20 at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
error 04-Jan-2016 15:07:20 at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
error 04-Jan-2016 15:07:20 at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
error 04-Jan-2016 15:07:20 at org.sonar.runner.api.Runner.execute(Runner.java:100)
error 04-Jan-2016 15:07:20 at org.sonar.runner.Main.executeTask(Main.java:70)
error 04-Jan-2016 15:07:20 at org.sonar.runner.Main.execute(Main.java:59)
error 04-Jan-2016 15:07:20 at org.sonar.runner.Main.main(Main.java:53)
error 04-Jan-2016 15:07:20 Caused by: java.lang.IllegalStateException: Failed to create lock in G:\.sonar_lock
error 04-Jan-2016 15:07:20 at org.sonar.home.cache.DirectoryLock.tryLock(DirectoryLock.java:67)
error 04-Jan-2016 15:07:20 at org.sonar.batch.scan.ProjectLock.tryLock(ProjectLock.java:43)
error 04-Jan-2016 15:07:20 at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:118)
error 04-Jan-2016 15:07:20 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:98)
error 04-Jan-2016 15:07:20 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
error 04-Jan-2016 15:07:20 at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
error 04-Jan-2016 15:07:20 at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
error 04-Jan-2016 15:07:20 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
error 04-Jan-2016 15:07:20 at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
error 04-Jan-2016 15:07:20 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
error 04-Jan-2016 15:07:20 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
error 04-Jan-2016 15:07:20 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
error 04-Jan-2016 15:07:20 at java.lang.reflect.Method.invoke(Method.java:606)
error 04-Jan-2016 15:07:20 at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
error 04-Jan-2016 15:07:20 ... 9 more
error 04-Jan-2016 15:07:20 Caused by: java.io.FileNotFoundException: G:\.sonar_lock (Access is denied)
error 04-Jan-2016 15:07:20 at java.io.RandomAccessFile.open(Native Method)
error 04-Jan-2016 15:07:20 at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
error 04-Jan-2016 15:07:20 at org.sonar.home.cache.DirectoryLock.tryLock(DirectoryLock.java:61)
error 04-Jan-2016 15:07:20 ... 22 more

Look inside your sonar-scan project directory and remove any .scannerwork file there. In my case I ran a test configuration outside of Jenkins as root and the .scannerwork file created in those test runs was conflicting with the sonar scans from Jenkins. I just deleted the file and Jenkins was able to create a new one without issues.

I'm not sure exactly what is going on with this but it appears to be some kind of configuration issue with the project. I finally did some cleanup on the project's configuration and finally got it to work on the last project that was giving me the error.

Related

Android emulator is not found React Native Problem

I'm setting up react native environment on windows machine, I set up all environment variables, according npx #react-native-community/cli doctor all is ok:
Common
✓ Node.js
✓ yarn
Android
✓ JDK
✓ Android Studio - Required for building and installing your app on Android
✓ Android SDK - Required for building and installing your app on Android
✓ ANDROID_HOME
Errors: 0
Warnings: 0
I have installed android studio, whe I run yarn android in a new brand react-native project, I get this output:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1442 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
echo %JAVA_HOME% returns current path when I print it in console. This is my Java version:
java 11.0.14 2022-01-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.14+8-LTS-263)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.14+8-LTS-263, mixed mode)

Node Sass Unsupported runtime error when building a Next.js project

I get this error message when I try to build my Next.js project; what is the problem?
> (base) net-MS24:~/Documents/myproject$ npm run build
> myproject#1.0.0 build
> next build
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Loaded env from /home/xxxy/Documents/myproject/.env
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://err.sh/next.js/built-in-css-disabled
info - Creating an optimized production build
Failed to compile.
./pages/content/_index.scss
Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
> Build error occurred
Error: > Build failed because of webpack errors
at build (/home/xxxy/Documents/myproject/node_modules/next/dist/build/index.js:15:918)

Unable to install Cobertura plugin in Jenkins

In my Jenkins 2.277.4, when I try to install Cobertura plugin in Jenkins, it gives me below error :
Cobertura Failure -
java.io.IOException: Failed to load: Jenkins Cobertura Plugin (1.16)
- Failed to load: Code Coverage API Plugin (1.4.0)
at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:950)
at hudson.PluginManager.dynamicLoad(PluginManager.java:930)
Caused: java.io.IOException: Failed to install cobertura plugin
at hudson.PluginManager.dynamicLoad(PluginManager.java:943)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2174)
Caused: java.io.IOException: Failed to dynamically deploy this plugin
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:2178)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1844)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:118)
at java.lang.Thread.run(Thread.java:748)
My aim is to show Code Coverage in Jenkins for my react application (I am using jest for react application)
There were couple of things that I tried :
Updated the dependencies related to Cobertura
Restart the jenkins server

Build fails when using file picker but when I use file_picker version less then 2.0.0 it works

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
D:\Working\flutter projects\todo_app\android\projects\todo_app\build\file_picker\intermediates\library_manifest\debug\AndroidManifest.xml:9:5-15:15: AAPT: error: unexpected element found in .
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 28s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin file_picker...
Checking the license for package SDK Patch Applier v4 in C:\Program Files\Android\Android Studio\licenses
Warning: License for package SDK Patch Applier v4 not accepted.
Checking the license for package Android Emulator in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android Emulator not accepted.
Checking the license for package Android SDK Platform-Tools in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android SDK Platform-Tools not accepted.

Getting an error while the project running on android

I'm trying run my project on android. But I get an error like that.
C:\Users\Alperen\Desktop\AwesomeProject>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\Alperen\Desktop\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\Alperen\Desktop\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\Alperen\Desktop\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async Command.handleAction (C:\Users\Alperen\Desktop\AwesomeProject\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:164:9)
I don't understand. What should I do ?

Resources