Project

General

Profile

Bug #65052

Use correct permissions for /var/log/netdata/debug.log

Added by Sean Vetter 7 months ago. Updated 6 months ago.

Status:
Done
Priority:
No priority
Assignee:
Waqar Ahmed
Category:
Services
Target version:
Seen in:
Severity:
Low Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

FreeNAS-11.2-RELEASE

Every time the netdata service starts this log message is created in /var/log/messages. Cannot open file '/var/log/netdata/debug.log'

This is the contents of that directory. The debug.log file does not exist.
ls l /var/log/netdata/
total 1
-rwSr----
1 netdata netdata 0 Dec 12 22:44 .keep

If I create the debug.log file and restart netdata the log message goes away.

After Reboot (Mini).png (50.3 KB) After Reboot (Mini).png Jeff Ervin, 01/31/2019 08:38 AM
After Reboot (VM).png (51 KB) After Reboot (VM).png Jeff Ervin, 01/31/2019 08:38 AM
Before Reboot (Mini).png (51.5 KB) Before Reboot (Mini).png Jeff Ervin, 01/31/2019 08:38 AM
Before Reboot (VM).png (102 KB) Before Reboot (VM).png Jeff Ervin, 01/31/2019 08:38 AM
Before Reboot (VM) 2.png (49.2 KB) Before Reboot (VM) 2.png Jeff Ervin, 01/31/2019 08:38 AM
Before Reboot (Mini) 2.png (101 KB) Before Reboot (Mini) 2.png Jeff Ervin, 01/31/2019 08:38 AM
51672
51679
51681
51690
51699
51706

Related issues

Copied to FreeNAS - Bug #68842: Use correct permissions for /var/log/netdata/debug.logDone

Associated revisions

Revision c1d4906d (diff)
Added by Waqar Ahmed 6 months ago

Correct permissions for log directory

This commit fixes a bug where some attributes were not preserved when we copied directories over to syslog dataset from base. It also makes sure that we reflect the permission structure from /conf/base/var/log in /var/log.
Ticket: #65052

History

#1 Updated by Sean Vetter 7 months ago

  • File debug-tubby-20181219154110.txz added
  • Private changed from No to Yes

#2 Updated by Dru Lavigne 7 months ago

  • Assignee changed from Release Council to William Grzybowski

#3 Updated by William Grzybowski 7 months ago

  • Assignee changed from William Grzybowski to Waqar Ahmed
  • Target version changed from Backlog to 11.2-U3
  • Severity changed from New to Low Medium

#4 Updated by Waqar Ahmed 7 months ago

  • Status changed from Unscreened to In Progress

#5 Updated by Waqar Ahmed 7 months ago

  • Status changed from In Progress to Blocked
  • Reason for Blocked set to Waiting for feedback

I have been unable to reproduce this issue. Looking at the logs, I can see that the issue is appearing as you describe in the logs. I wanted to ask, did you in any way make changes to netdata configuration files ? If yes please let me know what the changes were and how were they introduced ( order etc ). Thank you

#6 Updated by Sean Vetter 7 months ago

No I haven't made any changes. This was the first time I ever turned on netdata. Prior to the 11.2 release I was on 9.10.2-U6 which doesn't have netdata. I keep my system as stock as possible and don't make changes outside of the GUI.

Still ever time I turn on netdata I get this error.

#7 Updated by Waqar Ahmed 7 months ago

It is possible it might be a permissions issue. Can you please provide me with the output of the following command ?

ls -l /var/log/

Netdata should not start if the user is different though but making sure that we don't miss out anything while making a diagnosis. If this does not give us something solid to move on, can we perhaps schedule a team viewer session when you are available to debug this ?
Looking forward to hearing from you. Thank you

#8 Updated by Sean Vetter 7 months ago

Waqar Ahmed wrote:

I have been unable to reproduce this issue. Looking at the logs, I can see that the issue is appearing as you describe in the logs. I wanted to ask, did you in any way make changes to netdata configuration files ? If yes please let me know what the changes were and how were they introduced ( order etc ). Thank you

You know what else is interesting. The permissions on /var/log/netdata are different with a fresh install vs my upgraded install.

Fresh:
root@freenas[~]# stat /var/log/netdata
2264989443 40 drwxr-x--- 2 netdata netdata 4294967295 256 "Jan 3 10:46:09 2019" "Jan 3 10:46:05 2019" "Jan 3 10:46:05 2019" "Jan 3 02:38:03 2019" 4096 0 0x800 /var/log/netdata

Upgraded:
root@tubby:/var/log # stat /var/log/netdata/
1093881803 46 drwxr-xr-x 2 root wheel 4294967295 3 "Jan 3 13:21:06 2019" "Dec 19 07:40:11 2018" "Dec 19 07:40:11 2018" "Dec 12 23:15:44 2018" 4096 1 0x800 /var/log/netdata/

I created a vm with 9.10.2-U6 and then upgraded it to 11.2-U1 and 11.2 and did not see the permission problem like I have in my system. So that eliminates the upgrade issue. I dunno how this happened at this point. I changed the permission on that directory to match what it should be for now.

#9 Updated by Waqar Ahmed 7 months ago

Please confirm if the issue is resolved then ? If yes, we can update the ticket's status. Maybe at some point you used chown for the log directory ?

#10 Updated by Sean Vetter 7 months ago

Yeah I guess my personal issue is fixed. And since it doesn't seem like anyone else had this issue this is probably resolved. Without the ability to reproduce it we are at a dead end.

I didn't chown the log dir, all the other logs have correct ownership compared to a new fresh install. I'm not one to just go chown'ing system log files, why would you ever do that.

#11 Updated by Waqar Ahmed 7 months ago

  • Status changed from Blocked to In Progress
  • Reason for Blocked deleted (Waiting for feedback)

Actually that's not the case. We have a case where this scenario can happen. I'll be bringing up a PR to fix this issue. Thank you for your help in getting to the source of it

#12 Updated by Waqar Ahmed 6 months ago

  • Copied to Bug #68842: Use correct permissions for /var/log/netdata/debug.log added

#13 Updated by Bug Clerk 6 months ago

  • Status changed from In Progress to Ready for Testing

#14 Updated by Bug Clerk 6 months ago

  • Target version changed from 11.2-U3 to 11.2-U2

#15 Updated by Waqar Ahmed 6 months ago

Thank you Sean for your help

#16 Updated by Dru Lavigne 6 months ago

  • File deleted (debug-tubby-20181219154110.txz)

#17 Updated by Dru Lavigne 6 months ago

  • Subject changed from netdata: Cannot open file '/var/log/netdata/debug.log' to Use correct permissions for /var/log/netdata/debug.log
  • Private changed from Yes to No
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#20 Updated by Jeff Ervin 6 months ago

51672
51679
51681
51690
51699
51706

Test Passed FreeNAS-11.2-U2-INTERNAL81

#21 Updated by Dru Lavigne 6 months ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF