When I try to run mvn sonar:sonar -e in projects root dir build is falling with error:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Unable to read and import the source file : '/www/hudson/proj_beta/source/bin/report.php' with the charset : 'UTF-8'.
org.sonar.api.resources.File#10ade81[key=bin/report.php,dir=bin,filename=report.php,language=PHP]
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
Caused by: org.sonar.api.utils.SonarException: Unable to read and import the source file : '/www/hudson/c2c_beta/source/bin/report.php' with the charset : 'UTF-8'.
at org.sonar.api.batch.AbstractSourceImporter.parseDirs(AbstractSourceImporter.java:84)
at org.sonar.api.batch.AbstractSourceImporter.analyse(AbstractSourceImporter.java:69)
at org.sonar.api.batch.AbstractSourceImporter.analyse(AbstractSourceImporter.java:60)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
at org.sonar.batch.phases.Phases.execute(Phases.java:93)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:111)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:101)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:102)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.Batch.execute(Batch.java:100)
at org.sonar.maven.SonarMojo.executeBatch(SonarMojo.java:152)
at org.sonar.maven.SonarMojo.execute(SonarMojo.java:142)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
... 21 more
Caused by: org.sonar.api.resources.DuplicatedSourceException: org.sonar.api.resources.File#10ade81[key=bin/report.php,dir=bin,filename=report.php,language=PHP]
at org.sonar.batch.index.SourcePersister.saveSource(SourcePersister.java:45)
at org.sonar.batch.index.DefaultPersistenceManager.setSource(DefaultPersistenceManager.java:78)
at org.sonar.batch.index.DefaultIndex.setSource(DefaultIndex.java:402)
at org.sonar.batch.DefaultSensorContext.saveSource(DefaultSensorContext.java:159)
at org.sonar.api.batch.AbstractSourceImporter.parseDirs(AbstractSourceImporter.java:81)
... 37 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 23 seconds
[INFO] Finished at: Wed Feb 08 14:50:49 EET 2012
[INFO] Final Memory: 16M/42M
[INFO] ------------------------------------------------------------------------
It started to fall after unit-test were added to source dir.
Google search didn't give any clue.
The file is in utf-8:
report.php: text/plain; charset=utf-8
Any suggestions?
Looks like an open issue with Sonar, caused due to the same php file name in say, source and test folders. The issue exists for java as well. According to this, this should be fixed in the next release.
Possible Workaround:
If you encounter this problem, you can try to rename (if possible)
the test files that make the analysis fail
First, are all your sources encoded in UTF-8?
If so, have you tried removing the report.php source file, just to see if it's not only this class that has a problem?
Related
I have a server running LEMP stack that hosts a wide range websites. During the night, all the sites got shutdown and the message "502 bad gateway" Is displayed. I followed the stream of errors and concluded that php7.4-fpm was the issue. I need help to figure out how to solve the error below.
NOTE: During the night, no updates or changes has been made to the system
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2021-07-27 09:35:38 CEST; 7s ago
Docs: man:php-fpm7.4(8)
Process: 1561620 ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf (code=exited, status=78)
Process: 1561621 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
Main PID: 1561620 (code=exited, status=78)
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal php-fpm7.4[1561620]: [27-Jul-2021 09:35:38] ERROR: [/etc/php/7.4/fpm/php-fpm.conf:98] value is NULL for a ZEND_INI_PARSER_ENTRY
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal php-fpm7.4[1561620]: [27-Jul-2021 09:35:38] ERROR: failed to load configuration file '/etc/php/7.4/fpm/php-fpm.conf'
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal php-fpm7.4[1561620]: [27-Jul-2021 09:35:38] ERROR: FPM initialization failed
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: php7.4-fpm.service: Main process exited, code=exited, status=78/CONFIG
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: php7.4-fpm.service: Failed with result 'exit-code'.
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: Failed to start The PHP 7.4 FastCGI Process Manager.
I'm grateful for any ideas that you could have!
Just an idea, as I had the same error today setting up a fresh Alma linux server with httpd and php74-php-fpm from the remi repository.
I suggest the root cause of your problem was that the config had been altered some time before your shutdown, and that bad config then lurked causing no immediate problem. At the time of the problem your servers were restarted for some reason, maybe an overnight job run by someone else, a regular update of system packages leading to daemons being restarted, or a power failure. When they tried to start up again, they used the current config, which was by that time corrupt.
In my case I was editing the FPM config file /etc/opt/remi/php74/php-fpm.d/www.conf and accidentally used a # character for a comment, e.g. # My changes. On restarting the server, I got the same value is NULL for a ZEND_INI_PARSER_ENTRY error message in the journal. The line numbers mentioned did not help, they basically referred to how php-fpm.conf includes every file in php-fpm.d which happens to include www.conf but didn't specify which line had the error.
The fix in my case was to use the correct ; (semicolon) character, and not a #, for comments in www.conf.
This may not have been your case but I hope it helps someone :)
Update: I solved this issue by removing php7.4-fpm and installing it again. However, the problem still remains. Why did php7.4-fpm suddenly stopped working?
I'm encountering a weird problem with couchDB. Some documents in my database can't be updated due to unknown conflicts. When comparing them to other documents in Futon I don't see any big differences to other documents. When I try to update one of those documents the revision number jumps from e.g. 45 to 58 but no changes are visible.
This is what I see in the couchdb log file..
[Tue, 22 Nov 2016 13:45:10 GMT] [debug] [<0.30579.229>] Minor error in HTTP request: conflict
[Tue, 22 Nov 2016 13:45:10 GMT] [debug] [<0.30579.229>] Stacktrace: [{couch_db,update_doc,4,
[{file,"couch_db.erl"},{line,432}]},
{couch_httpd_db,update_doc,6,
[{file,"couch_httpd_db.erl"},
{line,753}]},
{couch_httpd_db,do_db_req,2,
[{file,"couch_httpd_db.erl"},
{line,234}]},
{couch_httpd,handle_request_int,5,
[{file,"couch_httpd.erl"},{line,318}]},
{mochiweb_http,headers,5,
[{file,"mochiweb_http.erl"},{line,94}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]
[Tue, 22 Nov 2016 13:45:10 GMT] [info] [<0.30579.229>] 127.0.0.1 - - PUT /DBNAME/external_link-35174841-41a5-44e3-a567-ec56209dc8b8-de_DE-1 409
[Tue, 22 Nov 2016 13:45:10 GMT] [debug] [<0.30579.229>] httpd 409 error response:
{"error":"conflict","reason":"Document update conflict."}
Any ideas what's going on here?
The docs say that conflicts can occur when several threads or programs try to update a document at the same time.
Are you sure you don't have another thread writing in your database, maybe a mapreduce? That would explain the different revision numbers.
I am trying to connect to NetSuite over ODBC from an Ubuntu Linux machine. I've got everything setup. It works via the shell, and PHP command line. But when I try and make this connection via a web request to PHP, it fails with this error:
Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Can't open lib '/opt/netsuite/odbcclient/lib64/ivoa25.so' : file not found, SQL state 01000 in SQLConnect in
In order for it to work from the shell, I had to add this to my .profile (via the readme.txt that came with the NetSuite driver)
ODBCINI="/opt/netsuite/odbcclient/odbc64.ini"
OASDK_ODBC_HOME="/opt/netsuite/odbcclient/lib64"
LD_LIBRARY_PATH="/opt/netsuite/odbcclient/lib64${LD_LIBRARY_PATH:+":"}${LD_LIBRARY_PATH:-""}"
export ODBCINI
export OASDK_ODBC_HOME
export LD_LIBRARY_PATH
The problem seems to be with setting the LD_LIBRARY_PATH. I noticed on this page about half way down the page it says
"Note: You can only set this environment variable inside an interactive shell."
The NetSuite driver requires this update to the LD_LIBRARY_PATH, so are there any other options to making a web request to execute my odbc_connect() statement?
I tried and failed with
putenv()
adding . /etc/odbcinst.ini to the /etc/init.d/php7.0-fpm script
adding the required statements & exports to /etc/environment (even though it said it wouldn't work)
added /opt/netsuite/odbcclient/lib64 to a new file /etc/ld.so.conf.d/netsuite.conf
When I did the last one from the above list, I ran sudo ldconfig successfully but got this error when trying to connect & query (bunch of garbage, but different error!):
[unixODBC]�pV�,8�(8��|D�x������H�R��ut�
(8eow�ut�(8�����|`gx�0x�pV�K����������M0�0�N��M0� ������4�
�0d��Ryy
I don't have an answer, but I can't comment at this point... I do, however, have information that may be useful.
I've been struggling with this NetSuite ODBC driver for Linux for a long time. One interesting thing I learned was that the driver is not compatible with Ubuntu 14.02. It IS compatible with 12.02 which is going out of support in April 2017. However, on a Ubuntu 12.02 VM I set up, I still get this same error. They posted an article about the compatibility in late May 2016 which was after I had given up with it and just developed on a Windows machine.
I am getting the same error when I use ISQL and was getting the same error in my PHP code. I chcked that the permissions were set to have anyone r and x but it's not working.
When run this command:
sudo ldd /opt/netsuite/odbcclient/lib64/ivoa25.so
I get this:
linux-vdso.so.1 => (0x00007ffebfb4b000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fcfefc08000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcfefa04000)
libicuuc.so.42 => not found
libicudata.so.42 => not found
libpam.so.0 => /lib/x86_64-linux-gnu/libpam.so.0 (0x00007fcfef7f6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcfef5d8000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcfef2d4000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcfeefce000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcfeedb8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcfee9f3000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcff01b6000)
libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007fcfee7cf000)
Which doesn't make sense because they are in the directory:
drwxr-xr-x 2 root root 4096 Jan 8 2016 .
drwxr-xr-x 8 root root 4096 Jul 28 16:45 ..
-rw-r--r-- 1 root root 1534752 Jan 8 2016 ddtrc25.so
-rw-r--r-- 1 root root 260915 Jan 8 2016 ivldap25.so
-rw-r--r-- 1 root root 12137 Jan 8 2016 ivmgan25.so
-rw-r--r-- 1 root root 124833 Jan 8 2016 ivmgapi25.so
-rw-r--r-- 1 root root 437482 Jan 8 2016 ivmghu25.so
-rw-r--r-- 1 root root 1521 Jan 8 2016 ivoa25.ini
-rwxr-xr-x 1 root root 3255664 Jan 8 2016 ivoa25.so
-rw-r--r-- 1 root root 14920460 Jan 8 2016 libddicu25.so
-rw-r--r-- 1 root root 16010036 Jan 8 2016 libicudata.so.42
-rw-r--r-- 1 root root 1608359 Jan 8 2016 libicuuc.so.42
-rw-r--r-- 1 root root 354900 Jan 8 2016 libivoa25m.so
-rw-r--r-- 1 root root 1172888 Jan 8 2016 libodbcinst.so
-rw-r--r-- 1 root root 1659688 Jan 8 2016 libodbc.so
-rw-r--r-- 1 root root 1457352 Jan 8 2016 odbccurs.so
-rw-r--r-- 1 root root 2154752 Jan 8 2016 openssl700.so
I get the file not found regardless of the permissions on the "not found" files. When I've created symbolic links to these files I was able to get the ivoa25.so not found error, but then got this one:
Warning: odbc_connect(): SQL error: [unixODBC], SQL state in SQLConnect in/var/www/html/DataBase.php on line 5
Could not connect:
With regard to this error, I contacted the guys at unixODBC.org and they said this:
Its a guess, but maybe try setting ODBCINI, the driver may need that to find the ini file
export ODBCINI=/etc/odbc.ini
but that didn't do anything either...
I'd love to help you fix this because it would help me too... we should compare notes.
UPDATE
with the error still in place using ISQL using the
$ odbcisql64 -m 0
command. When you run this it looks like this:
DataDirect OpenAccess SDK Interactive SQL (ODBC) Version 7.2
(c) Copyright 1995-2013 Progress Software Corporation. All rights reserved.
Program Locale:en_US.UTF-8
ISQL>
Trying to connect this way using the connection string
ISQL> connect "user"*"pw"#netsuite
I get the same error...
SQL: connecting to database: netsuite...
SQL: Can't connect to database netsuite
The following error information describes the failure
ODBC Call = SQLConnect()
SQL State = 01000
Native error = 0(0)
Error Message = [unixODBC][Driver Manager]Can't open lib '/opt/netsuite/odbcclient/lib64/ivoa25.so' : file not found
SQL: isql_connect() failure
Elapsed time 2 ms.
ISQL>
...however, I can 'connect' (At least it seems to connect) using this more generic isql command
$ isql NetSuite user pw
...it connects. This works on both Ubuntu 14 and 12. But I can't get any SQL commands to work and it looks different from the other ISQL connection result
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
So the solution ended up being simpler than expected. I essentially created a bash script that exports the environment variables I need then run the PHP script. Here's the entire contents of my netsuite-odbc.sh script. I can now connect and run my queries.
ODBCINI="/opt/netsuite/odbcclient/odbc64.ini"
OASDK_ODBC_HOME="/opt/netsuite/odbcclient/lib64"
LD_LIBRARY_PATH="/opt/netsuite/odbcclient/lib64${LD_LIBRARY_PATH:+":"}${LD_LIBRARY_PATH:-""}"
export ODBCINI
export OASDK_ODBC_HOME
export LD_LIBRARY_PATH
/usr/bin/php /home/user/netsuite-odbc.php
I have a new file server (FilServerB) that I have had up and running for a few months. I've been moving all my processing servers over to use FileServerB for their PHP code. I recently found a server (server name is susan) that I had missed, and it was still connecting to the old file server (FileServerA). When I mounted FileServerB on susan, none of the code would run on it anymore. In ssh, when I go to a directory with PHP code in it, and run "php cleanISL.php", it says this:
Fatal error: Unknown: Failed opening required 'cleanISL.php' (include_path='.:/local/online/live/common:/local/online/pear') in Unknown on line 0
If I create a new php file on the local filesystem, it runs just fine. If I try an is_file or is_directory for a file or directory that I know exists on the mounted filesystem, it always returns false. However, I can glob directories, and it shows the files in there just fine.
I've tried changing (and removing completely) my include_path, I've tried going back to the old file server (which works), and then unmounting the old one and mounting the new one the exact same way (still doesn't work), and a few other things. I can't tell if the issue is with PHP, or somehow with the way the server is mounted, or something else. I've made sure SELINUX is disabled. The issue seems to be only affecting PHP, and only when I mount the new FileServerB, and only on this particular server (susan). But I'm baffled at what could be causing it or how to fix it.
Also, I have mounts to other servers (for data/media) on this same server (susan), and those work just fine, ie, PHP can see and read files on those mounts too.
UPDATE 1, strace info
This is the relevant line of the strace on a failed is_dir:
stat64("/online/live/tools/test/fixes/", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
And this is the output of a stat command on the same dir:
File: `/online/live/tools/test/fixes/'
Size: 4096 Blocks: 8 IO Block: 32768 directory
Device: 18h/24d Inode: 11815229588 Links: 3
Access: (0775/drwxrwxr-x) Uid: ( 1004/ UNKNOWN) Gid: ( 1010/ UNKNOWN)
Access: 2016-07-06 07:28:46.606024801 -0600
Modify: 2016-06-24 16:23:42.206547505 -0600
Change: 2016-06-24 16:23:42.206547505 -0600
And this is a namei -m result:
dr-xr-xr-x /
lrwxrwxrwx online -> /mnt/code/online/
dr-xr-xr-x /
drwxr-xr-x mnt
drwxr-xr-x code
drwxr-xr-x online
drwxrwxrwx live
drwxrwxr-x tools
drwxrwxr-x test
drwxrwxr-x fixes
2013-11-21 17:26:21 Running command: "['C:\\Python27\\pythonw.exe', '-u', 'C:\\Program Files (x86)\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'--email=denashitug', '--passin', 'update', 'C:\\wamp\\www\\sems']"
05:26 PM Application: gcdc2013-sems; version: 1
05:26 PM Host: appengine.google.com
05:26 PM
Starting update of app: gcdc2013-sems, version: 1
05:26 PM Getting current resource limits.
Password for denashitug: 05:26 PM Scanning files on local disk.
2013-11-21 17:26:30,438 ERROR appcfg.py:1656 Invalid character in filename: images/userprofile/cartoon (1).jpg
2013-11-21 17:26:30,438 ERROR appcfg.py:1656 Invalid character in filename: images/userprofile/cartoon (2).jpg
2013-11-21 17:26:30,479 ERROR appcfg.py:1656 Invalid character in filename: images/gallery/cartoon (1).jpg
2013-11-21 17:26:30,480 ERROR appcfg.py:1656 Invalid character in filename: images/gallery/computer (1).jpg
Error 409: --- begin server output ---
Another transaction by user denashitug is already in progress for app: s~gcdc2013-sems, version: 1. That user can undo the transaction with "appcfg rollback".
--- end server output ---
2013-11-21 17:26:32 (Process exited with code 1)
You can close this window now.
I tried using a solution that was recently posted, but I still have same problem what should I do? It says that the application does not contain an app.yaml file, so now what should I do?
The problem is that you have previously aborted an update of your AppEngine app.
Before you can update it again, you first need to rollback that partial update. To do this run the command as it says.
appcgy.py rollback .