Permission Denied Error

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Permission Denied Error

Post by felix001 »

Ive set up Cacti but when i turn on debug mode for the graphs i get a error saying ...

RRDTool Says :
ERROR: opening '/var/www/cacti/rra/linux_server_hdd_free_30.rrd': Permission denied


Ive checked the rra and log folders which the following permissions ...

Code: Select all

drwxrwxrwx 2 root  cacti   4096 Sep 17 18:50 rra
drwxrwxrwx 2 root  cacti   4096 Sep 17 13:46 log
Can anyone point me to which permissions I may have wrong... ????

Many Thanks...
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Permission Denied Error

Post by Howie »

felix001 wrote:Ive set up Cacti but when i turn on debug mode for the graphs i get a error saying ...

RRDTool Says :
ERROR: opening '/var/www/cacti/rra/linux_server_hdd_free_30.rrd': Permission denied


Ive checked the rra and log folders which the following permissions ...

Code: Select all

drwxrwxrwx 2 root  cacti   4096 Sep 17 18:50 rra
drwxrwxrwx 2 root  cacti   4096 Sep 17 13:46 log
Can anyone point me to which permissions I may have wrong... ????

Many Thanks...
How about the file it is complaining about? It's an error opening, not creating.

(It's also not really good practice to make things 777...but that's another problem.)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Post by felix001 »

the issue is the read (lack of) permission on the rrd files for "others" ...

Code: Select all

-rw-r----- 1 cacti cacti  94664 Sep 17 20:50 linux_server_hdd_free_26.rrd

would it be my apache that hasnt got access to it... ???
Last edited by felix001 on Fri Sep 18, 2009 11:30 am, edited 1 time in total.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

felix001 wrote:the issue is the read (lack of) permission on the rrd files for "others" ...

-rw-r----- 1 cacti cacti 94664 Sep 17 20:50 linux_server_hdd_free_26.rrd


would it be my apache that hasnt got access to it... ???
The poller user needs read/write access to update. Apache needs read access to draw graphs. Allow 'others' to read would work, so would 'chgrp apache'.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Post by felix001 »

yep i tried this to test it and it works. The problem I have is when i create new rrd`s.

I tried placing the cacti user into the apache group which is defined within the httpd.conf ....

Code: Select all

User apache
Group apache
But this hasnt worked.. ?? Any ideas on a solution for a perm fix ???

Thanks for all your input ..
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

felix001 wrote:yep i tried this to test it and it works. The problem I have is when i create new rrd`s.

I tried placing the cacti user into the apache group which is defined within the httpd.conf ....

Code: Select all

User apache
Group apache
But this hasnt worked.. ?? Any ideas on a solution for a perm fix ???

Thanks for all your input ..
I didn't have to do anything special. One difference though is that my rra/ folder is owned by cacti, not root:

drwxrwxr-x 2 cacti www 1536 Sep 17 22:20 rra

which leaves the files inside like this:
-rw-r--r-- 1 cacti www 103712 Sep 17 22:20 local_poop_102.rrd

'www' is the user/group that apache runs as (for me), and cacti is not a member of that group.

So 'chown cacti:apache rra/' ?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Post by felix001 »

I just tried these settings but im having the same problem...

Code: Select all

drwxrwxr-x 2 cacti apache   4096 Sep 17 21:30 rra

[root@brian ~]# ls -l /var/www/cacti/rra/linux_server_load_1min_31.rrd
-rw-r----- 1 cacti cacti 141488 Sep 17 21:30 /var/www/cacti/rra/linux_server_load_1min_31.rrd
Wierd ?!?!
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

felix001 wrote:I just tried these settings but im having the same problem...

Code: Select all

drwxrwxr-x 2 cacti apache   4096 Sep 17 21:30 rra

[root@brian ~]# ls -l /var/www/cacti/rra/linux_server_load_1min_31.rrd
-rw-r----- 1 cacti cacti 141488 Sep 17 21:30 /var/www/cacti/rra/linux_server_load_1min_31.rrd
Wierd ?!?!
Apache can't read that file, can it?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Post by felix001 »

Nope ...
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Change the umask for the cron user to something like "umask 022". Put that in the .bashrc. Fix your existing permissions first.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Post by felix001 »

Thanks for your reply.

I was think of doing either the umask or sticky bit approach. Problem is before your last response, I tried to set the sticky bit of the rra directory for others....

Now no rrd files are created at all .... ??

Code: Select all

RRDTool Says:
ERROR: opening '/var/www/cacti/rra/linux_load_1min_41.rrd': No such file or directory

Code: Select all

[root@brian ~]# ls -l /var/www/cacti/ | grep rra
drwxrwxrwx 2 root  cacti   4096 Sep 17 23:03 rra
-rw-r--r-- 1 root  root    7088 Jun 28 16:07 rra.php
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Is it

Code: Select all

chmod +s rra
?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Post by felix001 »

I used the command

Code: Select all

chmod o+s rra
but took it off after it didnt make any difference. As you can see from the output of the permissions they are as required... ??
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well, if you don't understand Linux security, the other method would be to make the crontab user the Apache user and/or vice versa.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
felix001
Posts: 15
Joined: Thu Sep 17, 2009 2:48 pm

Post by felix001 »

ive tried,

Adding the cacti user to the apache user and group.
ive delete the rra folder and readded it with permissions of 777 and root:cacti

I get the same error when i run the poller as root (??)

Code: Select all

[root@localhost ~]#  /usr/bin/php /var/www/cacti/poller.php
09/19/2009 09:14:14 AM - POLLER: Poller[0] NOTE: Poller Int: '300', Cron Int: '300', Time Since Last: '246', Max Runtime '298', Poller Runs: '1'
09/19/2009 09:14:14 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/cacti/cmd.php" 0 0]
09/19/2009 09:14:14 AM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q "/var/www/cacti/cmd.php" 9 9]
Waiting on 1/2 pollers.
09/19/2009 09:14:16 AM - POLLER: Poller[0] Parsed MULTI output field '1min:0.00' [map 1min->load_1min]
09/19/2009 09:14:16 AM - POLLER: Poller[0] Parsed MULTI output field '5min:0.01' [map 5min->load_5min]
09/19/2009 09:14:16 AM - POLLER: Poller[0] Parsed MULTI output field '10min:0.00' [map 10min->load_15min]
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_users_62.rrd --template users N:2
ERROR: opening '/var/www/cacti/rra/servera_ucd_memavailreal_52.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_ucd_memtotalreal_53.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_ucd_memavailswap_54.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_ucd_memtotalswap_55.rrd': No such file or directory
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_load_15min_51.rrd --template load_1min:load_5min:load_15min N:0.00:0.01:0.00
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_load_15min_50.rrd --template load_15min N:0.00
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_load_1min_49.rrd --template load_1min N:0.00
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_ucd_sscpurawuser_48.rrd --template ucd_ssCpuRawUser N:9570
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_ucd_sscpurawsystem_47.rrd --template ucd_ssCpuRawSystem N:3566
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_ucd_sscpurawnice_46.rrd --template ucd_ssCpuRawNice N:0
09/19/2009 09:14:16 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/cacti/rra/servera_ucd_sscpurawidle_45.rrd --template ucd_ssCpuRawIdle N:3581472
09/19/2009 09:14:16 AM - SYSTEM STATS: Time:1.3501 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:18 RRDsProcessed:18
ERROR: opening '/var/www/cacti/rra/servera_load_15min_51.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_load_15min_50.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_load_1min_49.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_ucd_sscpurawuser_48.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_ucd_sscpurawsystem_47.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_ucd_sscpurawnice_46.rrd': No such file or directory
ERROR: opening '/var/www/cacti/rra/servera_ucd_sscpurawidle_45.rrd': No such file or directory
Loop  Time is: 1.3541989326477
Sleep Time is: 298.63879704475
Total Time is: 1.361202955246
So i think that this may no longer be a permissions issue.
The strange thing is... when i enable debug within datasources... there is no command syntax at the bottom of the screen.....

Also the clear poller cache script comes back with the error...

Code: Select all

PHP Fatal error:  Call to undefined function db_execute() in /var/www/cacti/rebuild_poller_cache.php on line 44
Which seems to me that my cacti is complete shoot..... if anyone has any ideas please let me know before i reinstall the whole thing....
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests