Good day All,
I am new to Alfresco and I am trying to install Alfresco in ubuntu via zip distribution files. I have been able to run the scripts so far but when I run the "07-install_solr.sh", I get the following error below:
[Install]
WantedBy=multi-user.target
Reloading systemd daemon...
Starting Solr service...
Job for solr.service failed because the control process exited with error code.
See "systemctl status solr.service" and "journalctl -xeu solr.service" for details.
Please if anyone has experienced this error and can assist me, I would really appreciate it.
Thanks,
Solved! Go to Solution.
Good day folks,
I was able to resolve this by doing the following:
1. if it gives you the error "logs folder not writable. Exiting". In the Linux terminal, go to /home/ubuntu/alfresco-search-services$ chmod 777 logs. This would make your logs folder writable for everyone.
2. Go to your PC and search for home/ubuntu/alfresco-search-services/logs folder and remove every file there except for:
a. log4j.properties b.README c.solr
rerun the bash script and everything should work. I hope this helps someone.
See "systemctl status solr.service" and "journalctl -xeu solr.service" for details.
Hi @angelborroy
I have run the commands to see the details and I am getting the following error below:
ejike@BlueFlame:/home/ubuntu$ systemctl status solr.service
× solr.service - Apache SOLR Web Application Container
Loaded: loaded (/etc/systemd/system/solr.service; disabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2024-08-19 16:14:31 WAT; 16s ago
Process: 2784 ExecStart=/home/ubuntu/alfresco-search-services/solr/bin/solr start -a -Dcreate.alfresco.defaults=alfresco,archive -Dalfresco.secureComms=secret -Dalfresco.secureComms.secret=secret (code=exit>
Aug 19 16:14:31 BlueFlame solr[2890]: at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)
Aug 19 16:14:31 BlueFlame solr[2890]: at java.base/java.nio.file.Files.move(Files.java:1432)
Aug 19 16:14:31 BlueFlame solr[2890]: at org.apache.solr.util.SolrCLI$UtilsTool.rotateSolrLogs(SolrCLI.java:3975)
Aug 19 16:14:31 BlueFlame solr[2890]: at org.apache.solr.util.SolrCLI$UtilsTool.runTool(SolrCLI.java:3869)
Aug 19 16:14:31 BlueFlame solr[2890]: at org.apache.solr.util.SolrCLI.main(SolrCLI.java:257)
Aug 19 16:14:31 BlueFlame solr[2784]: Failed rotating old solr logs
Aug 19 16:14:31 BlueFlame solr[2784]: ERROR: Logs directory ../../logs is not writable. Exiting
Aug 19 16:14:31 BlueFlame systemd[1]: solr.service: Control process exited, code=exited, status=1/FAILURE
Aug 19 16:14:31 BlueFlame systemd[1]: solr.service: Failed with result 'exit-code'.
Aug 19 16:14:31 BlueFlame systemd[1]: Failed to start solr.service - Apache SOLR Web Application Container.
ejike@BlueFlame:/home/ubuntu$ journalctl -xeu solr.service
Aug 19 16:14:30 BlueFlame solr[2848]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
Aug 19 16:14:30 BlueFlame solr[2848]: at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:477)
Aug 19 16:14:30 BlueFlame solr[2848]: at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)
Aug 19 16:14:30 BlueFlame solr[2848]: at java.base/java.nio.file.Files.move(Files.java:1432)
Aug 19 16:14:30 BlueFlame solr[2848]: at org.apache.solr.util.SolrCLI$UtilsTool.archiveGcLogs(SolrCLI.java:3903)
Aug 19 16:14:30 BlueFlame solr[2848]: at org.apache.solr.util.SolrCLI$UtilsTool.runTool(SolrCLI.java:3872)
Aug 19 16:14:30 BlueFlame solr[2848]: at org.apache.solr.util.SolrCLI.main(SolrCLI.java:257)
Aug 19 16:14:30 BlueFlame solr[2784]: Failed archiving old GC logs
Aug 19 16:14:31 BlueFlame solr[2869]: Exception in thread "main" java.nio.file.AccessDeniedException: /home/ubuntu/alfresco-search-services/solr/server/../../logs/solr-8983-console.log -> /home/ubuntu/alfresco->
Aug 19 16:14:31 BlueFlame solr[2869]: at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
Aug 19 16:14:31 BlueFlame solr[2869]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
Aug 19 16:14:31 BlueFlame solr[2869]: at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:477)
Aug 19 16:14:31 BlueFlame solr[2869]: at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)
Aug 19 16:14:31 BlueFlame solr[2869]: at java.base/java.nio.file.Files.move(Files.java:1432)
Aug 19 16:14:31 BlueFlame solr[2869]: at org.apache.solr.util.SolrCLI$UtilsTool.archiveConsoleLogs(SolrCLI.java:3932)
Aug 19 16:14:31 BlueFlame solr[2869]: at org.apache.solr.util.SolrCLI$UtilsTool.runTool(SolrCLI.java:3875)
Aug 19 16:14:31 BlueFlame solr[2869]: at org.apache.solr.util.SolrCLI.main(SolrCLI.java:257)
Aug 19 16:14:31 BlueFlame solr[2784]: Failed archiving old console logs
Aug 19 16:14:31 BlueFlame solr[2890]: Exception in thread "main" java.nio.file.AccessDeniedException: /home/ubuntu/alfresco-search-services/solr/server/../../logs/solr.log -> /home/ubuntu/alfresco-search-servic>
Aug 19 16:14:31 BlueFlame solr[2890]: at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
Aug 19 16:14:31 BlueFlame solr[2890]: at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
Aug 19 16:14:31 BlueFlame solr[2890]: at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:477)
Aug 19 16:14:31 BlueFlame solr[2890]: at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266)
Aug 19 16:14:31 BlueFlame solr[2890]: at java.base/java.nio.file.Files.move(Files.java:1432)
Aug 19 16:14:31 BlueFlame solr[2890]: at org.apache.solr.util.SolrCLI$UtilsTool.rotateSolrLogs(SolrCLI.java:3975)
Aug 19 16:14:31 BlueFlame solr[2890]: at org.apache.solr.util.SolrCLI$UtilsTool.runTool(SolrCLI.java:3869)
Aug 19 16:14:31 BlueFlame solr[2890]: at org.apache.solr.util.SolrCLI.main(SolrCLI.java:257)
Aug 19 16:14:31 BlueFlame solr[2784]: Failed rotating old solr logs
Aug 19 16:14:31 BlueFlame solr[2784]: ERROR: Logs directory ../../logs is not writable. Exiting
Aug 19 16:14:31 BlueFlame systemd[1]: solr.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit solr.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Aug 19 16:14:31 BlueFlame systemd[1]: solr.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit solr.service has entered the 'failed' state with result 'exit-code'.
Aug 19 16:14:31 BlueFlame systemd[1]: Failed to start solr.service - Apache SOLR Web Application Container.
░░ Subject: A start job for unit solr.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit solr.service has finished with a failure.
░░
░░ The job identifier is 1384 and the job result is failed.
Please what could the issue be?
Thanks
Good day folks,
I was able to resolve this by doing the following:
1. if it gives you the error "logs folder not writable. Exiting". In the Linux terminal, go to /home/ubuntu/alfresco-search-services$ chmod 777 logs. This would make your logs folder writable for everyone.
2. Go to your PC and search for home/ubuntu/alfresco-search-services/logs folder and remove every file there except for:
a. log4j.properties b.README c.solr
rerun the bash script and everything should work. I hope this helps someone.
Hi
This script resolve this problem:
#!/bin/bash
set -e
echo "Unzip SOLR ZIP Distribution File"
mkdir /tmp/solr
unzip downloads/alfresco-search-services-2.0.9.1.zip -d /tmp/solr
mv /tmp/solr/alfresco-search-services /home/ubuntu
# Variables
SOLR_USER=ubuntu
SOLR_GROUP=ubuntu
SOLR_HOME=/home/ubuntu/alfresco-search-services
SOLR_LOG_DIR=$SOLR_HOME/logs
echo "Creating SOLR systemd service file..."
cat <<EOL | sudo tee /etc/systemd/system/solr.service
[Unit]
Description=Apache SOLR Web Application Container
After=network.target
[Service]
Type=forking
User=$SOLR_USER
Group=$SOLR_GROUP
Environment="JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
ExecStart=$SOLR_HOME/solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive -Dalfresco.secureComms=secret -Dalfresco.secureComms.secret=secret"
ExecStop=$SOLR_HOME/solr/bin/solr stop
[Install]
WantedBy=multi-user.target
EOL
# Ensure logs directory is writable
echo "Setting permissions for Solr logs directory..."
sudo mkdir -p $SOLR_LOG_DIR
sudo chown -R $SOLR_USER:$SOLR_GROUP $SOLR_LOG_DIR
sudo chmod -R 755 $SOLR_LOG_DIR
echo "Reloading systemd daemon..."
sudo systemctl daemon-reload
echo "Starting Solr service..."
sudo systemctl start solr
echo "Stopping Solr service..."
sudo systemctl stop solr
echo "Enabling Solr service to start on boot..."
sudo systemctl enable solr
echo "SOLR has been configured"
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.