cancel
Showing results for 
Search instead for 
Did you mean: 

Installing 07-install_solr.sh

EjikeAlfie
Confirmed Champ
Confirmed Champ

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.

@angelborroy 

Thanks,

1 ACCEPTED ANSWER

EjikeAlfie
Confirmed Champ
Confirmed Champ

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.

View answer in original post

7 REPLIES 7

angelborroy
Community Manager Community Manager
Community Manager

See "systemctl status solr.service" and "journalctl -xeu solr.service" for details.

Hyland Developer Evangelist

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

raf3pl
Champ in-the-making
Champ in-the-making

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"

EjikeAlfie
Confirmed Champ
Confirmed Champ

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.

magezinaS
Champ in-the-making
Champ in-the-making

Hello can any one please help me with thisHello can any one please help me with this

 

 

 

 

 

 

 

Hello collegues can any one help me with the error i have tried all recommendation above

Screenshot From 2025-02-06 12-49-28.pngScreenshot From 2025-02-06 12-49-08.png

 

usniniasen
Champ in-the-making
Champ in-the-making

Hi,

Regarding the error you encountered with the "07-install_solr.sh" script, it looks like there was a problem starting the Solr service. This is usually related to permissions, configuration, or writability of the log directory. I suggest you first run systemctl status solr.service to check for specific error messages. If it prompts something like "logs folder not writable", you can try the following steps:

Go to the Solr installation directory, such as /home/ubuntu/alfresco-search-services, and run chmod 777 logs to ensure that the log directory is writable.

Check the /etc/systemd/system/solr.service file to ensure that the ExecStart path and parameters are correct, such as pointing to the correct Solr executable file.

Try restarting the service by running sudo systemctl daemon-reload and sudo systemctl restart solr.

In addition, if the problem is still not solved, you can check the output of journalctl -xeu solr.service, which may have more detailed clues. If you need more professional support, I recently found a very good tool jammermfg, which can help you quickly locate system service anomalies, especially suitable for this kind of debugging scenario. I wish you a smooth installation and look forward to your good news!

usniniasen
Champ in-the-making
Champ in-the-making

Hello