Stuck at some unknown error

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

I am very new to Sonarcloud. Never used this before in production. Recently I have been given a task to integrate the snorcloud into AWS code pipeline. I am deploying a PHP application through code pipeline. I have followed some tutorials to achieve this. Faced like 20+ issues out of which I as able to resolve 19 :slight_smile: but stuck at point where I cant find any help on google. Here are the error logs from AWS codebuild:

============================================================================
21:16:18.118 WARN: Failed to resolve 13 include/require statements like ‘Amazon/MarketplaceWebService/Client.php’ from ‘classes’, ‘Amazon/MarketplaceWebService/Model/CancelFeedSubmissionsRequest.php’ from ‘classes’, ‘Amazon/MarketplaceWebService/Model/GetFeedSubmissionListRequest.php’ from ‘classes’, ‘Amazon/MarketplaceWebService/Model/GetFeedSubmissionResultRequest.php’ from ‘classes’, ‘Amazon/MarketplaceWebService/Model/IdList.php’ from ‘classes’, ‘Amazon/MarketplaceWebService/Model/SubmitFeedRequest.php’ from ‘classes’, ‘Amazon/MarketplaceWebServiceSellers/Client.php’ from ‘classes’, ‘Amazon/MarketplaceWebServiceSellers/Model/ListMarketplaceParticipationsRequest.php’ from ‘classes’, ‘class-wc-settings-advanced.php’ from ‘views’, ‘live_activity.php’ from ‘common’
864 21:16:21.036 INFO: 13513/13514 files analyzed, current file: wp-content/plugins/woo-permalink-manager/index.php
865 21:16:24.575 INFO: 13514/13514 source files have been analyzed
866 21:16:24.577 INFO: No PHPUnit test report provided (see ‘sonar.php.tests.reportPath’ property)
867 21:16:24.578 INFO: No PHPUnit coverage reports provided (see ‘sonar.php.coverage.reportPaths’ property)
868 21:16:24.578 INFO: Sensor PHP sensor [php] (done) time=1529254ms
869 21:16:24.578 INFO: Sensor Analyzer for “php.ini” files [php]
870 21:16:24.624 DEBUG: ‘php.ini’ generated metadata with charset ‘UTF-8’
871 21:16:24.680 DEBUG: ‘shop-06-jul/php.ini’ generated metadata with charset ‘UTF-8’
872 21:16:24.777 INFO: Sensor Analyzer for “php.ini” files [php] (done) time=199ms
873 21:16:24.777 INFO: Sensor CFamily [cpp]
874 21:16:24.781 INFO: CFamily plugin version: 6.20.0.31240
875 21:16:24.781 ERROR:
876
877 The only way to get an accurate analysis of C/C++/Objective-C files is by using the SonarSource build-wrapper
878 and setting the property “sonar.cfamily.build-wrapper-output”, but it was not specified.
879
880 If you don’t want to analyze C/C++/Objective-C files, then prevent them from being analyzed by setting the following properties:
881
882 sonar.c.file.suffixes=-
883 sonar.cpp.file.suffixes=-
884 sonar.objc.file.suffixes=-
885
886
887 21:16:24.793 WARN: Failed to close server
888 java.net.ConnectException: Failed to connect to /127.0.0.1:42759
889 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:249)
890 at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:167)
891 at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
892 at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
893 at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
894 at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
895 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
896 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
897 at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
898 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
899 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
900 at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
901 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
902 at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
903 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
904 at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
905 at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264)
906 at okhttp3.RealCall.execute(RealCall.java:93)
907 at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.request(EslintBridgeServerImpl.java:226)
908 at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.clean(EslintBridgeServerImpl.java:311)
909 at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.stop(EslintBridgeServerImpl.java:336)
910 at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.stop(StartableCloseableSafeLifecyleStrategy.java:38)
911 at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.stop(AbstractInjectionFactory.java:88)
912 at org.picocontainer.behaviors.AbstractBehavior.stop(AbstractBehavior.java:179)
913 at org.picocontainer.behaviors.Stored$RealComponentLifecycle.stop(Stored.java:141)
914 at org.picocontainer.behaviors.Stored.stop(Stored.java:118)
915 at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContainer.java:1048)
916 at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:803)
917 at org.sonar.core.platform.ComponentContainer.stopComponents(ComponentContainer.java:152)
918 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:111)
919 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
920 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
921 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
922 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
923 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
924 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
925 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
926 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
927 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
928 at java.base/java.lang.reflect.Method.invoke(Unknown Source)
929 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
930 at com.sun.proxy.$Proxy0.execute(Unknown Source)
931 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
932 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
933 at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
934 at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
935 at org.sonarsource.scanner.cli.Main.main(Main.java:61)
936 Caused by: java.net.ConnectException: Connection refused (Connection refused)
937 at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
938 at java.base/java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
939 at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
940 at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
941 at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
942 at java.base/java.net.Socket.connect(Unknown Source)
943 at okhttp3.internal.platform.Platform.connectSocket(Platform.java:130)
944 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:247)
945 … 46 common frames omitted
946
947 21:16:25.055 DEBUG: stylelint-bridge server will shutdown
948 21:16:30.083 INFO: ------------------------------------------------------------------------
949 21:16:30.083 INFO: EXECUTION FAILURE
950 21:16:30.083 INFO: ------------------------------------------------------------------------
951 21:16:30.083 INFO: Total time: 35:23.431s
952 21:16:30.364 INFO: Final Memory: 153M/514M
953 21:16:30.364 INFO: ------------------------------------------------------------------------
954 21:16:30.364 ERROR: Error during SonarScanner execution
955 java.lang.UnsupportedOperationException:
956
957 The only way to get an accurate analysis of C/C++/Objective-C files is by using the SonarSource build-wrapper
958 and setting the property “sonar.cfamily.build-wrapper-output”, but it was not specified.
959
960 If you don’t want to analyze C/C++/Objective-C files, then prevent them from being analyzed by setting the following properties:
961
962 sonar.c.file.suffixes=-
963 sonar.cpp.file.suffixes=-
964 sonar.objc.file.suffixes=-
965
966
967 at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:208)
968 at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:175)
969 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:45)
970 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
971 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
972 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
973 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
974 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
975 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:442)
976 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:438)
977 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:396)
978 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
979 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
980 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
981 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
982 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
983 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
984 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
985 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
986 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
987 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
988 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
989 at java.base/java.lang.reflect.Method.invoke(Unknown Source)
990 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
991 at com.sun.proxy.$Proxy0.execute(Unknown Source)
992 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
993 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
994 at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
995 at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
996 at org.sonarsource.scanner.cli.Main.main(Main.java:61)
997
998 [Container] 2021/05/20 21:16:30 Command did not exit successfully sonar-scanner -Dsonar.organization=integratechfze -Dsonar.projectKey=mohsin-123 -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=6b3b5ee0a5392846a8d732251c09337bbdccd468 -X exit status 1
999 [Container] 2021/05/20 21:16:30 Phase complete: PRE_BUILD State: FAILED
1000 [Container] 2021/05/20 21:16:30 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: sonar-scanner -Dsonar.organization=integratechfze -Dsonar.projectKey=mohsin-123 -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=6b3b5ee0a5392846a8d732251c09337bbdccd468 -X. Reason: exit status 1

=============================================================================

Can someone please help me to solve these errors.
Thank you very much in advance.

Hello @mohsin-integratech and welcome to our community!

One thing is not clear to me: it seems that your project contains php files as well as c or cpp files, right?
But what languages do you want to analyze? Only php files or also c/c++ files?

Hi @Amelie,

My client’s code is mainly PHP, around 78%. However, it was quite a big code, 2.8 GB’s and 3.3 million code lines. 18% is JS and the rest other languages. This is issue was solved by writing these lines (to exclude the c/c++ files) in my sonar-project.properties file.
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-

Do you mean you don’t have any error anymore and everything works as expected?

yes, @Amelie. However, after resolving this issue, I have “java.lang.OutOfMemoryError: Java heap space*”* , and this was solved by increasing the memory of my AWS codebuild Server.

Thanks @mohsin-integratech for the update :slight_smile:

@Amelie my pleasures

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.