Installation

Why this error when upgrading "Exception: <class 'PermissionError'>, Value: [Errno 13] Permission denied"?

tb582
Explorer

Upgrading to VERSION=8.0.4.1 I'm getting this error running as ROOT!!

Migrating to:

VERSION=8.0.4.1
BUILD=ab7a85abaa98
PRODUCT=splunk
PLATFORM=Linux-x86_64

Copying '/opt/splunk/etc/myinstall/splunkd.xml' to '/opt/splunk/etc/myinstall/splunkd.xml-migrate.bak'.

Checking saved search compatibility...

Handling deprecated files...

Checking script configuration...


An unforeseen error occurred:

Exception: <class 'PermissionError'>, Value: [Errno 13] Permission denied: '/opt/splunk/etc/system/local/inputs.conf.tmp'

Traceback (most recent call last):
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/cli.py", line 1353, in <module>
sys.exit(main(sys.argv))
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/cli.py", line 1206, in main
parseAndRun(argsList)
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/cli.py", line 1061, in parseAndRun
retVal = cList.getCmd(command, subCmd).call(argList, fromCLI = True)
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/cli.py", line 293, in call
return self.func(args, fromCLI)
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/control_api.py", line 30, in wrapperFunc
return func(dictCopy, fromCLI)
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/_internal.py", line 189, in firstTimeRun
migration.autoMigrate(args[ARG_LOGFILE], isDryRun)
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/migration.py", line 3094, in autoMigrate
migInputs_3_3_0(migInputsConf, dryRun)
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/migration.py", line 1682, in migInputs_3_3_0
comm.sed(policySearch, policyReplace, path, inPlace = True)
File "/opt/splunk/lib/python3.7/site-packages/splunk/clilib/cli_common.py", line 1232, in sed
outFile = open(tmpPath, 'w')
PermissionError: [Errno 13] Permission denied: '/opt/splunk/etc/system/local/inputs.conf.tmp'

Please file a case online at http://www.splunk.com/page/submit_issue

Error running pre-start tasks

Root is how I always run the upgrade process yet never have run into this issue before!

Labels (2)
0 Karma

tgendron_splunk
Splunk Employee
Splunk Employee

I had the same problem going doing an upgrade from 8.2.4 to 8..5

I went to the directory where the permission error was shown at the end of the Traceback like this 

   f = open(path, 'w')

PermissionError: [Errno 13] Permission denied: '/opt/splunk/etc/system/local/indexes.conf'

Some of the files where read only so I did a  chmod 660 * and that fixed it.

0 Karma

panguy
Contributor

I had this same problem when upgrading Splunk.

After untaring the TGZ file to my $SPLUNK_HOME.

cd $SPLUNK_ROOT_DIR
ls -lah

This confirmed the owner of the folder changed to 10777

I went ahead and ran this line to fix permissions

chown -R splunk:splunk $SPLUNK_HOME

 

In your case change the user to root.

 

Hope that helps.

Tags (1)

Quadra
Engager

This also worked for me.
Upgrade from 9.0.4 to 9.1.1

0 Karma

smoir
Splunk Employee
Splunk Employee

Thanks panguy, this is exactly what I needed!

0 Karma

The_Simko
Path Finder

1. Is Splunk offline?

2. Who owns the processes?

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...