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

Bad filesystem detection (NFS) #12217

Closed
odlan opened this issue Oct 23, 2017 · 8 comments · Fixed by #17695
Closed

Bad filesystem detection (NFS) #12217

odlan opened this issue Oct 23, 2017 · 8 comments · Fixed by #17695
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@odlan
Copy link

odlan commented Oct 23, 2017

Piwik 3.2.0

This is the system where Piwik run
df -T

shell

I have no NFS system, but Piwik think so

piwik_nfs_error

@Findus23
Copy link
Member

Hi,

Can you check the following:

  • df -T -t nfs
    It should return df: no file systems processed or something similar
  • If you are allowing the exec function in PHP
  • If you are allowing the shell_exec function in PHP

The only thing I can think of is that this check fails
https://github.com/piwik/piwik/blob/3.x-dev/core/Filesystem.php#L147
because the locale is not English and for whatever reason returns more than one line.

@odlan
Copy link
Author

odlan commented Oct 23, 2017

Hi

  • user@diskstation:~# df -T -t nfs
    df: no file systems processed

  • df -T -t nfs /volume1/web/piwik/tmp/sessions 2>&1
    Filesystem Type 1K-blocks Used Available Use% Mounted on
    - - 3732213600 857454592 2874759008 23% /volume1/web

Locale is "en_US.utf8"

@Findus23
Copy link
Member

df -T -t nfs /volume1/web/piwik/tmp/sessions 2>&1
Filesystem Type 1K-blocks Used Available Use% Mounted on
- - 3732213600 857454592 2874759008 23% /volume1/web

That's odd. Can you try if any parameter causes df to not show that filesystem when filtering for nfs.

Which df are you using? The GNU one or something else?

What does df --version return

@odlan
Copy link
Author

odlan commented Oct 23, 2017

df --version
df (GNU coreutils) 8.24
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjörn Granlund, David MacKenzie, and Paul Eggert.

but
df -T /volume1/
/dev/vg1000/lv btrfs 3732213600 857643756 2874569844 23% /volume1

and

df -T -t ntfs /volume1/
df: no file systems processed

@odlan
Copy link
Author

odlan commented Oct 23, 2017

@Seb35
Copy link
Contributor

Seb35 commented Jun 16, 2021

I also experience this issue: the directory tmp is a btrfs subvolume and it confuses df. The linked bug on Lauchpad is also reported upstream, it seems complicated.

Is it possible to add a supplementary condition in Matomo in the NFS check, something like && strpos( ' nfs ', implode("\n", $output) ) !== false to work around this issue? I can prepare the patch.

@diosmosis
Copy link
Member

Hi @Seb35, a change like that could work, and we'd welcome a pull request.

Seb35 added a commit to WikiValley/matomo that referenced this issue Jun 18, 2021
Exclude unrecognized filesystems like btrfs subvolumes.
NFS filesystems are identified as 'nfs' or 'nfs4'.

Issue: matomo-org#12217
Seb35 added a commit to WikiValley/matomo that referenced this issue Jun 28, 2021
Exclude unrecognized filesystems like btrfs subvolumes.
NFS filesystems are identified as 'nfs' or 'nfs4'.

Issue: matomo-org#12217
@diosmosis diosmosis added this to the 4.4.0 milestone Jun 29, 2021
@diosmosis diosmosis added the Bug For errors / faults / flaws / inconsistencies etc. label Jun 29, 2021
diosmosis pushed a commit that referenced this issue Jun 29, 2021
Exclude unrecognized filesystems like btrfs subvolumes.
NFS filesystems are identified as 'nfs' or 'nfs4'.

Issue: #12217
@diosmosis diosmosis linked a pull request Jun 29, 2021 that will close this issue
10 tasks
@diosmosis
Copy link
Member

Fixed by #17695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants