Closed serge-vk closed 6 years ago
I've just ran into this (pretty old) perl script for reporting freebsd memory stats.
I stand corrected about procfs. This file system is, indeed, available in FreeBSD. However, it is not mounted by default. Further on, the node structure is completely different from that of Linux (for example, no meminfo) and information is provided by individual process node.
Now on Nextcloud 11 I got a fatal PHP error which should be suppressed. file_get_contents(/proc/meminfo): failed to open stream: No such file or directory at nextcloud/apps/serverinfo/lib/SystemStatistics.php#71
I fixed the file_get_contents issue with #71
We are trying to read the available and free memory. If anyone of you can fix the method with a call to whatever works on freebsd, we can try to get it in as a fallback when the proc/meminfo doesn't work
I have been looking around for memory info options on FreeBSD (or any BSD, for that matter). Unfortunately, so far I do not see how to avoid executing external commands/processes. About the only way to access total/free physical memory info on FreeBSD is to call /sbin/sysctl
. The relevant keys to request are:
Key | Description |
---|---|
vm.stats.vm.v_page_size | Page size in bytes |
vm.stats.vm.v_page_count | Total number of pages in system |
vm.stats.vm.v_free_count | Free pages |
The memory stats can be also calculated from some different keys, but the general principle is that sysctl
or other external code needs to be called. While searching, I noticed a bunch of scripts that implement this functionality. The most interesting seem to be: phpSysInfo and freebsd-memory.sh.
Maybe, there is no way similar to Linux /proc/meminfo
, but I am not sufficiently familiar with FreeBSD innards to make a statement.
would it be possible to disable this broken functionality in freebsd until a solution is found. My logs are filled with
Error file_get_contents(/proc/meminfo): failed to open stream: No such file or directory at /usr/local/www/nextcloud/apps/serverinfo/lib/SystemStatistics.php#71
Work around is: https://github.com/nextcloud/serverinfo/pull/76/files
Sorry for jumping in late, but are there plans for adding *BSD support for this problem?
I used the sysctl
-output to calculate the memory usage. Take a look at my pull request and feel free to test it: https://github.com/nextcloud/serverinfo/pull/106
Steps to reproduce
Expected behaviour
Memory information displayed in the appropriate field
Actual behaviour
Memory info not available
is displayed beneath the Memory usage title.Most likely, this happens because Server info app assumes that memory status can be read from
/proc/meminfo
on any system, and there is no procfs on BSD. As far as I know, at least some of this information can be accessed throughsysctl hw
but I am not sure about which exact keys have to be queried (since I don't even see what memory information is supposed to be reported). Alternatively,procstat
can be used as well, but it reports information about specific processes rather than totals.Although the absence of this information in itself is not a big deal, the php logs are spammed with /proc/meminfo errors and that is not good.
Server configuration
Operating system: FreeBSD 10.3 p7 Web server: Nginx 1.11.3 Database: MariaDB 10.1.17 PHP version: 7.0.10 NextCloud version: 10.0 stable (downloaded from
https://download.nextcloud.com/server/releases/nextcloud-10.0.0.zip
and updated from ownCloud 9.0.53)Signing status:
Signing status
``` No errors have been found. ```List of activated apps:
App list
``` Enabled: - activity: 2.3.2 - admin_audit: 1.0.0 - bookmarks: 0.9.0 - calendar: 1.3.3 - comments: 1.0.0 - dav: 1.0.0 - direct_menu: 0.9.2 - documents: 0.13.1 - encryption: 1.3.1 - federatedfilesharing: 1.0.1 - federation: 1.0.1 - files: 1.5.2 - files_accesscontrol: 1.1.2 - files_automatedtagging: 1.1.1 - files_pdfviewer: 0.8.1 - files_retention: 1.0.0 - files_sharing: 1.0.0 - files_texteditor: 2.1 - files_trashbin: 1.0.0 - files_versions: 1.3.0 - files_videoplayer: 0.9.8 - firstrunwizard: 1.1 - gallery: 15.0.0 - news: 9.0.4 - notes: 2.0.2 - notifications: 0.3.0 - password_policy: 1.0.0 - provisioning_api: 1.0.0 - serverinfo: 1.1.1 - survey_client: 0.1.5 - systemtags: 1.0.2 - tasks: 0.9.3 - templateeditor: 0.1 - theming: 1.0.1 - updatenotification: 1.0.1 - weather: 1.3.3 - workflowengine: 1.0.1 Disabled: - external - files_external - user_external - user_ldap - user_saml ```The content of config/config.php:
Config report
``` { "system": { "instanceid": "ocffm874ikqy", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "datadirectory": "\/mnt\/ocData", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "9.1.0.16", "dbname": "OwnCloud", "dbhost": "localhost:\/tmp\/mysql.sock", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "loglevel": 0, "appstore.experimental.enabled": true, "mail_smtpmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "PLAIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "trashbin_retention_obligation": "30, 365", "asset-pipeline.enabled": false, "logtimezone": "***REMOVED SENSITIVE VALUE***", "memcache.locking": "\\OC\\Memcache\\Redis", "filelocking.enabled": "true", "memcache.local": "\\OC\\Memcache\\Redis", "redis": { "host": "\/var\/run\/redis\/redis.sock", "port": 0, "timeout": 0, "dbindex": 0 }, "logfile": "\/var\/log\/owncloud.log", "activity_expire_days": 365, "enable_avatars": true, "session_lifetime": 10800, "preview_libreoffice_path": "\/usr\/local\/bin\/libreoffice", "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown", "OC\\Preview\\PDF", "OC\\Preview\\OpenDocument", "OC\\Preview\\MSOfficeDoc" ], "debug": true, "preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore --convert-to pdf --outdir ", "mail_smtpsecure": "ssl", "versions_retention_obligation": "auto, 365", "maintenance": false, "htaccess.RewriteBase": "\/nextcloud", "updater.release.channel": "stable", "theme": "" }, "apps": { "activity": { "enabled": "yes", "installed_version": "2.3.2", "types": "filesystem" }, "admin_audit": { "enabled": "yes", "installed_version": "1.0.0", "types": "logging" }, "announcementcenter": { "enabled": "no", "installed_version": "1.1.2", "ocsid": "173921", "signed": "true", "types": "" }, "backgroundjob": { "lastjob": "50" }, "bookmarks": { "enabled": "yes", "installed_version": "0.9.0", "ocsid": "168710", "types": "" }, "calendar": { "enabled": "yes", "installed_version": "1.3.3", "ocsid": "168707", "types": "" }, "comments": { "enabled": "yes", "installed_version": "1.0.0", "types": "logging" }, "contacts": { "enabled": "no", "installed_version": "1.3.1.0", "ocsid": "168708", "types": "" }, "core": { "backgroundjobs_mode": "cron", "default_encryption_module": "OC_DEFAULT_MODULE", "encryption_enabled": "yes", "installedat": "1460675482.7736", "lastcron": "1473968711", "lastupdateResult": "[]", "lastupdatedat": "1473967779", "oc.integritycheck.checker": "[]", "public_documents": "documents\/public.php", "public_files": "files_sharing\/public.php", "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php", "remote_caldav": "dav\/appinfo\/v1\/caldav.php", "remote_calendar": "dav\/appinfo\/v1\/caldav.php", "remote_carddav": "dav\/appinfo\/v1\/carddav.php", "remote_contacts": "dav\/appinfo\/v1\/carddav.php", "remote_dav": "dav\/appinfo\/v2\/remote.php", "remote_files": "dav\/appinfo\/v1\/webdav.php", "remote_webdav": "dav\/appinfo\/v1\/webdav.php", "repairlegacystoragesdone": "yes", "shareapi_default_expire_date": "yes", "shareapi_enforce_expire_date": "yes", "shareapi_enforce_links_password": "yes", "umgmt_send_email": "false", "umgmt_show_backend": "false", "umgmt_show_email": "false", "umgmt_show_last_login": "false", "umgmt_show_storage_location": "false", "updater.secret.created": "1469040139" }, "dav": { "enabled": "yes", "installed_version": "1.0.0", "types": "filesystem" }, "direct_menu": { "enabled": "yes", "installed_version": "0.9.2", "ocsid": "169148", "types": "" }, "documents": { "converter": "local", "converter_url": "http:\/\/localhost:16080", "enabled": "yes", "installed_version": "0.13.1", "ocsid": "168711", "types": "", "unstable": "false" }, "encryption": { "enabled": "yes", "installed_version": "1.3.1", "masterKeyId": "master_51747b1f", "publicShareKeyId": "pubShare_51747b1f", "recoveryKeyId": "recoveryKey_51747b1f", "types": "filesystem" }, "federatedfilesharing": { "enabled": "yes", "installed_version": "1.0.1", "types": "" }, "federation": { "enabled": "yes", "installed_version": "1.0.1", "types": "authentication" }, "files": { "cronjob_scan_files": "500", "enabled": "yes", "installed_version": "1.5.2", "types": "filesystem" }, "files_accesscontrol": { "enabled": "yes", "installed_version": "1.1.2", "types": "filesystem" }, "files_antivirus": { "av_path": "\/usr\/bin\/clamscan", "enabled": "no", "installed_version": "0.8.0.1", "ocsid": "157439", "signed": "true", "types": "filesystem" }, "files_automatedtagging": { "enabled": "yes", "installed_version": "1.1.1", "types": "filesystem" }, "files_pdfviewer": { "enabled": "yes", "installed_version": "0.8.1", "ocsid": "166049", "types": "" }, "files_retention": { "enabled": "yes", "installed_version": "1.0.0", "types": "filesystem" }, "files_sharing": { "enabled": "yes", "installed_version": "1.0.0", "types": "filesystem" }, "files_texteditor": { "enabled": "yes", "installed_version": "2.1", "ocsid": "166051", "types": "" }, "files_trashbin": { "cronjob_user_offset": "1000", "enabled": "yes", "installed_version": "1.0.0", "types": "filesystem" }, "files_versions": { "enabled": "yes", "installed_version": "1.3.0", "types": "filesystem" }, "files_videoplayer": { "enabled": "yes", "installed_version": "0.9.8", "types": "" }, "firstrunwizard": { "enabled": "yes", "installed_version": "1.1", "ocsid": "166055", "types": "" }, "gallery": { "enabled": "yes", "installed_version": "15.0.0", "types": "" }, "galleryplus": { "enabled": "no", "installed_version": "15.1.1", "ocsid": "169116", "types": "" }, "news": { "enabled": "yes", "installed_version": "9.0.4", "ocsid": "168040", "types": "" }, "notes": { "enabled": "yes", "installed_version": "2.0.2", "ocsid": "174554", "types": "" }, "notifications": { "enabled": "yes", "installed_version": "0.3.0", "types": "logging" }, "ownnote": { "enabled": "no", "folder": "Notes", "installed_version": "1.08", "ocsid": "168512", "types": "" }, "password_policy": { "enabled": "yes", "installed_version": "1.0.0", "minLength": "12", "types": "" }, "provisioning_api": { "enabled": "yes", "installed_version": "1.0.0", "types": "prevent_group_restriction" }, "serverinfo": { "enabled": "yes", "installed_version": "1.1.1", "types": "" }, "survey_client": { "enabled": "yes", "installed_version": "0.1.5", "types": "" }, "systemtags": { "enabled": "yes", "installed_version": "1.0.2", "types": "logging" }, "tasks": { "enabled": "yes", "installed_version": "0.9.3", "ocsid": "164356", "types": "" }, "templateeditor": { "enabled": "yes", "installed_version": "0.1", "types": "" }, "theming": { "cachebuster": "3", "color": "#0F5596", "enabled": "yes", "installed_version": "1.0.1", "types": "logging" }, "updatenotification": { "direct_menu": "0.9.2", "enabled": "yes", "installed_version": "1.0.1", "types": "" }, "weather": { "enabled": "yes", "installed_version": "1.3.3", "ocsid": "170605", "types": "" }, "workflowengine": { "enabled": "yes", "installed_version": "1.0.1", "types": "filesystem" } } } ```Are you using external storage, if yes which one: no
Are you using encryption: yes
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: FireFox 48.0.1
Operating system: Mac OS X 10.10.5
Logs
Web server error log
Nginx error log
``` No entries ```PHP log
PHP-FPM log
``` [15-Sep-2016 13:06:24] WARNING: [pool www] child 89030 said into stderr: "awk: can't open file /proc/meminfo" [15-Sep-2016 13:06:24] WARNING: [pool www] child 89030 said into stderr: " source line number 1" [15-Sep-2016 13:06:25] WARNING: [pool www] child 89030 said into stderr: "awk: can't open file /proc/meminfo" [15-Sep-2016 13:06:25] WARNING: [pool www] child 89030 said into stderr: " source line number 1" [15-Sep-2016 13:06:26] WARNING: [pool www] child 89030 said into stderr: "awk: can't open file /proc/meminfo" [15-Sep-2016 13:06:26] WARNING: [pool www] child 89030 said into stderr: " source line number 1" ```Nextcloud log (data/nextcloud.log)
Nextcloud log
Only cron debug messages and some complaints about not being able to re-calculate unencrypted size for some files and not being able to decrypt some files in `files_versions`