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
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...