Permission denied @ rb_sysopen - /home/oxidized/.config/oxidized/config

Hello,

I have no idea why I can’t get Oxidized running in docker. Maybe I should use the binary install instead, here is what I have tried:

I’m using - GitHub - ytti/oxidized: Oxidized is a network device configuration backup tool. It's a RANCID replacement!

I’ve create a user called ‘oxidized’ and have logged in as that user and followed the instructions.

I git cloned to here:

oxidized@server-oxidized:~/oxidized$ ls
bin  CHANGELOG.md  CONTRIBUTING.md  Dockerfile  docs  examples  extra  Gemfile  lib  LICENSE  oxidized.gemspec  Rakefile  README.md  spec  TODO.md

Built the container:

sudo docker build -q -t oxidized/oxidized:latest oxidized/
[sudo] password for oxidized:
sha256:5036f23f2b65f6f31c4463193b0c61ca5a5dd9ebcc37279baf12b04774a032fa

Then created the directory:

mkdir /etc/oxidized

Then proceeded to run it:

docker run --rm -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp --user oxidized -t oxidized/oxidized:latest oxidized
Permission denied @ rb_sysopen - /home/oxidized/.config/oxidized/config

Permissions look ok I think:

oxidized@server-oxidized:~/oxidized$ ls -lah
total 156K
drwxrwxr-x 10 oxidized oxidized 4.0K Nov 29 14:23 .
drwxr-x---  5 oxidized oxidized 4.0K Nov 29 14:26 ..
drwxrwxr-x  2 oxidized oxidized 4.0K Nov 29 14:23 bin
-rw-rw-r--  1 oxidized oxidized  37K Nov 29 14:23 CHANGELOG.md
-rw-rw-r--  1 oxidized oxidized   71 Nov 29 14:23 .codeclimate.yml
-rw-rw-r--  1 oxidized oxidized 8.6K Nov 29 14:23 CONTRIBUTING.md
-rw-rw-r--  1 oxidized oxidized 3.7K Nov 29 14:23 Dockerfile
drwxrwxr-x  3 oxidized oxidized 4.0K Nov 29 14:23 docs
drwxrwxr-x  4 oxidized oxidized 4.0K Nov 29 14:23 examples
drwxrwxr-x  2 oxidized oxidized 4.0K Nov 29 14:23 extra
-rw-rw-r--  1 oxidized oxidized   38 Nov 29 14:23 Gemfile
drwxrwxr-x  8 oxidized oxidized 4.0K Nov 29 14:23 .git
drwxrwxr-x  3 oxidized oxidized 4.0K Nov 29 14:23 .github
-rw-rw-r--  1 oxidized oxidized 1.1K Nov 29 14:23 .gitignore
drwxrwxr-x  3 oxidized oxidized 4.0K Nov 29 14:23 lib
-rw-rw-r--  1 oxidized oxidized  12K Nov 29 14:23 LICENSE
-rw-rw-r--  1 oxidized oxidized 2.6K Nov 29 14:23 oxidized.gemspec
-rw-rw-r--  1 oxidized oxidized 2.0K Nov 29 14:23 Rakefile
-rw-rw-r--  1 oxidized oxidized  16K Nov 29 14:23 README.md
-rw-rw-r--  1 oxidized oxidized 2.3K Nov 29 14:23 .rubocop_todo.yml
-rw-rw-r--  1 oxidized oxidized 1.9K Nov 29 14:23 .rubocop.yml
drwxrwxr-x  7 oxidized oxidized 4.0K Nov 29 14:23 spec
-rw-rw-r--  1 oxidized oxidized 1.1K Nov 29 14:23 TODO.md

Any help would be most appreciated.

Thanks

Try somewhere other than /etc/oxidized

I posted this in response to your discord query

I had to use ~/oxidized instead of /etc/oxidized as I’m on a mac but aside from that it worked ok for me.

laf@laptop Code % docker run --rm -v ~/oxidized/:/home/oxidized/.config/oxidized -p 8888:8888/tcp --user oxidized -t oxidized/oxidized:latest oxidized
edit /home/oxidized/.config/oxidized/config
laf@laptop Code % vi ~/oxidized/config 
laf@laptop Code % docker run --rm -v ~/oxidized/:/home/oxidized/.config/oxidized -p 8888:8888/tcp --user oxidized -t oxidized/oxidized:latest oxidized
I, [2024-12-01T22:30:27.412058 #1]  INFO -- : Oxidized starting, running as pid 1
F, [2024-12-01T22:30:27.415950 #1] FATAL -- : Oxidized crashed, crashfile written in /home/oxidized/.config/oxidized/crash
no source csv config, edit /home/oxidized/.config/oxidized/config

I get the same issue where ever I try it. I’ve built a new Ubuntu VM too and same issue, a couple of us can’t figure this one out.

The documentation suggests you create a /etc/oxidized but I see from your config you don’t need that.

Can you think of anything else we can try?

/etc/oxidized is just a director on the host running docker, you can pick what you want here. Like I said I used ~/oxidized so it runs in my home dir but that’s mainly because I use MacOS

I’ve installed using the binary install method instead and it worked straight away with one switch backing up which is perfect. Shows in LibreNMS too.

Out of interest do you know of the router.db that gets created can be accessed to view?

I wanted to see if I could also display the backup details in Grafana too.

router.db is just the csv source file, you can’t access it through Oxidized but you could see if /nodes?format=json via the oxidized web interface gives you what you want.

1 Like

That’s perfect thanks. I’ve got nearly 50 switches added so far. 2 will not backup eventhough I can see Oxidized log in, I think it’s a time out as these 2 switches take ages to respond, is there a timeout feature I can edit at all?

timeout: 200 in your config file.

Thanks that works, I set to 40 and they are backing up now.

Does Oxidize log why it couldn’t backup at all anywhere to give you a hint?

Thank you.

Yes and has debug options to create more output. The docs on github have these options available.