Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "Access to file '' is not permitted." #52

Closed
SanskritFritz opened this issue Jan 31, 2016 · 14 comments
Closed

Error: "Access to file '' is not permitted." #52

SanskritFritz opened this issue Jan 31, 2016 · 14 comments

Comments

@SanskritFritz
Copy link
Contributor

I have started netdata, copied the default config to /etc/netdata, but I get this error in the browser:
Access to file '' is not permitted.
Here is the log:
https://gist.github.com/153990a3fae7b3010c62
Please help me fixing this.

@ktsaou
Copy link
Member

ktsaou commented Jan 31, 2016

I don't see it.
At which line number?

@ktsaou
Copy link
Member

ktsaou commented Jan 31, 2016

I think it was given to you on your browser.

Can you give me the URL that caused netdata respond with this?

@ktsaou
Copy link
Member

ktsaou commented Jan 31, 2016

I see in the code this message can be given if the web files are not owned by the user netdata runs.

If you installed netdata on your system, the web files should be at /usr/share/netdata/web.

Check the directory and its contents.
If netdata runs as user netdata, this directory and its contents should be owned by this user too.

ktsaou added a commit that referenced this issue Jan 31, 2016
@ktsaou
Copy link
Member

ktsaou commented Jan 31, 2016

I added a log line to error log for this. The line states the path to the problematic filename its current owner and the wanted one.

@SanskritFritz
Copy link
Contributor Author

Thanks, I see. I missed setting the permissions in my package. However, I find it strange that those files are not readable by netdata. Does the program try to change any file under /usr? Because all files are visible by any user in the system, even if they are root owned.

@ktsaou
Copy link
Member

ktsaou commented Jan 31, 2016

However, I find it strange that those files are not readable by netdata.

The internal web browser of netdata refuses to serve files not owned by its user. Security rules.

@SanskritFritz
Copy link
Contributor Author

I see, thanks for the info. Now it works beautifully here too.

@Porco-Rosso
Copy link

Hi I'm having troubles with the same issue, what exactly did you run?
Nether
chown root -R /root/netdata/netdata/usr
Nor
chown netdata:netdata -R /root/netdata/netdata/usr
Help

(I ran the install to the folder ~/netdata)

@ktsaou
Copy link
Member

ktsaou commented Mar 31, 2016

netdata drops its privileges when started.
It becomes user netdata.
So, install it outside /root (prefer /tmp if you plan to delete it later).
If you really want to start it as root, add -u root to the command line, but I strongly suggest against this practice.

@Porco-Rosso
Copy link

Just got it up and running, thanks! I'm still learning the ropes.

@quixand
Copy link

quixand commented Sep 22, 2016

"netdata drops its privileges when started. It becomes user netdata."
This is a very important bit of info.

@CholtonATX
Copy link

I installed Netdata as a sudoer, everything in /usr/share/netdata/web is owned by user netdata, but I am still getting 'access to file not permitted'. Do I have to run /usr/sbin/netdata AS user netdata?

@SanskritFritz
Copy link
Contributor Author

On Wed, Nov 16, 2016 at 5:29 AM, Fleetside58 notifications@github.com
wrote:

I installed Netdata as a sudoer, everything in /usr/share/netdata/web is
owned by user netdata, but I am still getting 'access to file not
permitted'. Do I have to run /usr/sbin/netdata AS user netdata?

No, by default netdata drops to the netdata user when you run it as root,
unless you configured it differently. I run netdata from systemd with no
special settings:

root@HomeC ~# ps -ef | grep netdata
netdata 23194 1 0 10:36 ? 00:00:01 /usr/bin/netdata -D
netdata 23200 23194 0 10:36 ? 00:00:00 bash
/usr/lib/netdata/plugins.d/tc-qos-helper.sh 1
netdata 23209 23194 0 10:36 ? 00:00:01
/usr/lib/netdata/plugins.d/apps.plugin 1
netdata 23215 23194 0 10:36 ? 00:00:01 /usr/sbin/python
/usr/lib/netdata/plugins.d/python.d.plugin 1
netdata 24335 23200 0 10:41 ? 00:00:00 sleep 0.994
root 24343 23156 0 10:41 pts/4 00:00:00 grep --color=auto netdata

@ktsaou
Copy link
Member

ktsaou commented Nov 16, 2016

Get `http://your.netdata.ip:19999/netdata.conf and seek for these 2 options:

[global]
    # run as user = 
    # web files owner = 

If they are empty, like the ones above, user netdata is assumed. If they are not empty, these are the permissions the web files should have.

Check also /var/log/netdata/error.log, it should give you some info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants