Monday, September 2, 2019

gitlab Error - execute[semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp] (gitlab::selinux line 20) had an error: Errno::ENOENT: No such file or directory - semodule


While configuring gitlab if you get the above error, it means either the module semodule ( /usr/sbin/semodule) does not exist or the way you are configuring gitlab  does have access to execute the file /usr/sbin/semodule.
Are you using any cron or shell script to configure gitlab?
Because if you are configuring gitlab on terminal by user root, it is not possible you get this error if no respective module is corrupted.

Error executing action `run` on resource 'execute[semodule -i /opt/gitlab/embedded/selinux/rhel/7/gitlab-7.2.0-ssh-keygen.pp]'
Solution :
gitlab has its own bin directory where it has all the necessary executable files.
Default Path of the directory is /opt/gitlab/bin. (You can find this path in gitlab configuration file i.e. /etc/gitlab/gitlab.rb)
Make a soft link for the file.
sudo ln -s /usr/sbin/semodule /opt/gitlab/bin

Now configure gitlab using same methid, you should not get the error.

Orangehrm / Symphony Error - Parse error: syntax error, unexpected ''mo' (T_ENCAPSED_AND_WHITESPACE), expecting ') symfony/cache/orangehrm/prod/config/config_autoload.yml.php

Solution :
1. Check your disk usage, is it filled completely? Empty some space, restart Apache and check again.
2. If above solution is not applicable,
Remove the file symfony/cache/orangehrm/prod/config/config_autoload.yml.php. Now open the page in browser again. It will create new config_autoload.yml.php. Error should be gone now.
Make sure the directory has write permissions to create the file.

Java - Run jar file on non default port

If you are running a jar file using command
java -jar filename.jar
Suppose it runs on port 8080. But you have already another service like Tomcat or Jenkins running on port 8080 so your jar file can not run on port 8080. Here is an option '-Dserver.port', Using the option you can choose the port on which your jar file should be run.
java -Dserver.port=8999 -jar filename.jar
Now your service will run on port 8999.