Splunk Enterprise

splunk reload deployment server error

jadengoho
Builder

Hi, just want to ask why im getting this error and how to make this right :

An error occurred: Could not create Splunk settings directory at '/root/.splunk'.

Ialways get that when i am reloading the Splunk Deployment server

Tags (1)
0 Karma
1 Solution

xpac
SplunkTrust
SplunkTrust

It's basically: Splunk is not running as root (which is good), but you're logged in as root (which is not so good).
When you try to login (which is required to reload the deployment server), Splunk saves your login (which would be a cookie if you we're using a browser) in a folder in your home directory (/root/.splunk/). But as Splunk does not run as root, it has no permissions to do that, therefore the error message.

Solution: Do not work as root, especially not while editing files on a non-root Splunk, it will bring you into trouble.
I'd suggest using a normal user, you could use the user Splunk is running at.

Hope that helps!

View solution in original post

xpac
SplunkTrust
SplunkTrust

It's basically: Splunk is not running as root (which is good), but you're logged in as root (which is not so good).
When you try to login (which is required to reload the deployment server), Splunk saves your login (which would be a cookie if you we're using a browser) in a folder in your home directory (/root/.splunk/). But as Splunk does not run as root, it has no permissions to do that, therefore the error message.

Solution: Do not work as root, especially not while editing files on a non-root Splunk, it will bring you into trouble.
I'd suggest using a normal user, you could use the user Splunk is running at.

Hope that helps!

jadengoho
Builder

./splunk reload deploy-server
ERROR: Couldn't determine $SPLUNK_HOME or $SPLUNK_ETC; perhaps one should be set in environment

0 Karma

xpac
SplunkTrust
SplunkTrust

Try this, it depends on your system environment:

source /opt/splunk/bin/setSplunkEnv

That will set the variables and also allow you to issue Splunk commands from any folder, just by starting with splunk.... You could then put that line into your .bashrc or .bash_profile or whatever your system runs when you login. 😉

0 Karma

jadengoho
Builder

That doesn't work on my side.

But I Finally know the answer :
We are login to our Username (e.g: FirstName.LastName)
and for us to do the command

./splunk reload deploy-server

We need to log in as a user in the splunk :

sudo su splunk
./splunk reload deploy-server
(this prompt me to enter my splunk credentials) 
and then it will RUN the command
0 Karma

jadengoho
Builder

if is do SUDO = An error occurred: Could not create Splunk settings directory at '/root/.splunk'.
if no SUDO =Couldn't determine $SPLUNK_HOME or $SPLUNK_ETC; perhaps one should be set in environment
how can i reload the deployment server ?

0 Karma

jadengoho
Builder

How can i do that in CLI ?
to run the command ./splunk reload deploy-server

0 Karma

jadengoho
Builder

I see this answer but i cant really understand it : https://answers.splunk.com/answers/211892/could-not-create-splunk-settings-directory-at-root.html
can somebody tell me the procedure ?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...