Do the login require for SonarQube?

Hi Team,
I am trying to use SonarQube in my local mac machine. I have followed the steps and successfully executed the command but on http://localhost:9000/projects?sort=-analysis_date page display This project is empty

Kindly help.

Also do SonarQube require login using GITHUB / BITBUCKET account?

Hi,

Could you be more explicit about what steps you’ve followed and what command you’ve executed? It’s not really clear right now what’s going on.

 
Ann

Hi Ann,

Do sonar require login using GITHUB / BITBUCKET account to show projects error on http://localhost:9000/projects?sort=-analysis_date ?

I am trying to integrate continuous inspection, I have generated sonarlint.json and it’s showing more than 1k error of different type but when I am visiting on http://localhost:9000/projects?sort=-analysis_date ? than above page saying The Projects is empty

A much needed help is important with quick response.

Hi @ShivankA.

No, it isn’t required.

Are you analyzing your code using a SonarQube Scanner? SonarLint doesn’t send your code to the server, that’s why you don’t see the project in the SonarQube UI.

1 Like

Hi @felipebz
Yes I am analyzing the code using SonarQube but I don’t see the project on server.

Could you share the command that you’re running to analyze the code?

Please give me some time as days back I tried.

Hi @felipebz,

Can you help me on this error

sh run-sonar-swift.sh -nounittests

Running run-sonar-swift.sh…

-n .

-n Extracting Xcode project information

** BUILD FAILED **

ERROR - Command ‘xcodebuild clean build -workspace FMS.xcworkspace -scheme FMS -destination platform=iOS Simulator,name=iPhone 7,OS=12.2 -destination-timeout 360 COMPILER_INDEX_STORE_ENABLE=NO’ failed with error code: 65

It would be helpful if you provide quick solutions to save time

Sonar-Properties file
sonar.projectKey=FMS
sonar.projectName=FMS
sonar.swift.projectVersion=1.0
sonar.swift.project=FMS.xcodeproj
sonar.swift.workspace=FMS.xcworkspace
sonar.swift.language=swift
sonar.swift.appScheme=FMS
sonar.swift.sourceEncoding=UTF-8
sonar.sources=FMS
sonar.swift.simulator=platform=iOS Simulator,name=iPhone 7,OS=12.2

Hi @felipebz,

I have succesfully compile the project using below command
sh run-sonar-swift.sh -nounittests

I am getting This project is empty. on localhost:9000.

A much NEEDFUL help is needed ASAP.

Hi,

Without the content of run-sonar-swift.sh, knowing that you ran it isn’t very helpful. However, I’m guessing from your earlier error message that your script simply compiles your project. You must also run a scanner. The docs should help with that.

You’ve provided the contents of your sonar-project.properties(?) file. I’m wondering where you got most of those properties. I don’t recognize any of these:

 

Fortunately, they won’t interfere with analysis; they’ll simply be ignored. Here’s the list of common parameters, which you might find helpful. However, this should be enough to get you started:

sonar.projectKey=FMS
sonar.projectName=FMS
sonar.projectVersion=1.0

 

You’ll also need to provide sonar.host.url, altho whether that happens in the global scanner configuration (see first link), your sonar-project.properties or on the command line (-Dsonar.host.url=...) is up to you.

 
Ann

Hi ,
After run a scanner I am having certain errors using command sonar-scanner
FYI

java.lang.IllegalStateException: Failed to create lock in /**Project-Directory**/.scannerwork/.sonar_lock
at org.sonar.scanner.scan.DirectoryLock.tryLock(DirectoryLock.java:52)
at org.sonar.scanner.scan.ProjectLock.tryLock(ProjectLock.java:46)
at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:137)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.io.FileNotFoundException: /**Project-Directory**/.scannerwork/.sonar_lock (Permission denied)
at java.base/java.io.RandomAccessFile.open0(Native Method)
at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:347)
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:261)
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:216)
at org.sonar.scanner.scan.DirectoryLock.tryLock(DirectoryLock.java:46)
... 21 more

AND my sonar-scanner.properties file is

#Configure here general information about the environment, such as SonarQube server connection details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
#----- Default source code encoding
#sonar.sourceEncoding=UTF-8
sonar.verbose=true

Hi,

Here’s your problem:

Does the user running the analysis property have full rights on the .scannerwork directory? Do you have background tasks running (e.g. a virus scanner) which could be preventing access?

 
Ann

Unfortunately I am having same problem.

System Preferences

  • Admin permission on login user
  • JAVA 8 is installed.

A much NEEDFUL help is IMP.

Hi,

Until you sort out the permission issue, there’s not much anyone can do to help you.

 
Ann

BTW, it seems you’re using this plugin instead of the commercial plugin from SonarSource. Could you confirm it?

I think yes as I have followed the instructions from SonarQube open source.

Do it require paid plugin?

@Team,
Any other problem or it’s a permission denied issue (As system is having admin permission) ?

:worried:

@Team,

I am waiting for valuable help

I am running this command

sudo sonar-scanner -X