Pfsense Unable to open /cf/conf/config.xml for writing in write_config() @



  • Hi @all

    Seit dem letzten Update kann ich auf meiner Pfsense keine Firewall Regeln erstellen bzw. ein Update einspielen weil ich nicht mehr in die config schreiben kann da ich die Rechte nicht besitze.

    Version 2.3-RELEASE (amd64)
    built on Mon Apr 11 18:10:34 CDT 2016
    FreeBSD 10.3-RELEASE

    Pfsense Infos:
    Version 2.3.1_1 is available.
    Platform nanobsd (4g)
    NanoBSD Boot Slice pfsense1 / da0s2(rw)
    CPU Type AMD G-T40E Processor
    2 CPUs: 1 package(s) x 2 core(s)
    Uptime 17 Days 22 Hours 53 Minutes 38 Seconds
    Current date/time
    Thu Jun 2 12:09:30 UTC 2016
    Last config change Wed Apr 27 20:51:38 UTC 2016

    Ein Reboot der FW hat mein Problem natürlich nicht behoben.

    Weiss Jemand wie man das fixen kann? Am liebsten mit putty (port/SSH aktivieren?) wenn möglich.

    Das wäre der Crashreport:

    amd64
    10.3-RELEASE
    FreeBSD 10.3-RELEASE #6 05adf0a(RELENG_2_3_0): Mon Apr 11 18:52:07 CDT 2016    root@ce23-amd64-builder:/builder/pfsense-230/tmp/obj/builder/pfsense-230/tmp/FreeBSD-src/sys/pfSense

    Crash report details:

    PHP Errors:
    [02-Jun-2016 09:55:20 Etc/UTC] PHP Stack trace:
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  1. {main}() /usr/local/www/pkg_mgr_install.php:0
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  2. write_config() /usr/local/www/pkg_mgr_install.php:451
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  3. backup_config() /etc/inc/config.lib.inc:553
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  4. copy() /etc/inc/config.lib.inc:920
    [02-Jun-2016 09:55:20 Etc/UTC] PHP Stack trace:
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  1. {main}() /usr/local/www/pkg_mgr_install.php:0
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  2. write_config() /usr/local/www/pkg_mgr_install.php:451
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  3. backup_config() /etc/inc/config.lib.inc:553
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  4. filesize() /etc/inc/config.lib.inc:927
    [02-Jun-2016 09:55:20 Etc/UTC] PHP Stack trace:
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  1. {main}() /usr/local/www/pkg_mgr_install.php:0
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  2. write_config() /usr/local/www/pkg_mgr_install.php:451
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  3. backup_config() /etc/inc/config.lib.inc:553
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  4. fopen() /etc/inc/config.lib.inc:928
    [02-Jun-2016 09:55:20 Etc/UTC] PHP Stack trace:
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  1. {main}() /usr/local/www/pkg_mgr_install.php:0
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  2. write_config() /usr/local/www/pkg_mgr_install.php:451
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  3. backup_config() /etc/inc/config.lib.inc:553
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  4. fwrite() /etc/inc/config.lib.inc:929
    [02-Jun-2016 09:55:20 Etc/UTC] PHP Stack trace:
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  1. {main}() /usr/local/www/pkg_mgr_install.php:0
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  2. write_config() /usr/local/www/pkg_mgr_install.php:451
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  3. backup_config() /etc/inc/config.lib.inc:553
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  4. fclose() /etc/inc/config.lib.inc:930
    [02-Jun-2016 09:55:20 Etc/UTC] PHP Stack trace:
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  1. {main}() /usr/local/www/pkg_mgr_install.php:0
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  2. write_config() /usr/local/www/pkg_mgr_install.php:451
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  3. safe_write_file() /etc/inc/config.lib.inc:565
    [02-Jun-2016 09:55:20 Etc/UTC] PHP  4. fopen() /etc/inc/config.lib.inc:495


  • Moderator

    Was sagt denn das Syslog sonst dazu? Hat die Maschine vielleicht keinen Speicherplatz mehr frei? Oder ist das File defekt?



  • Das Syslog sagt das ich im "Read Only" mode bin und deshalb keine Config Änderungen speichern kann. Somit ist es mir nicht möglich die Firewall per Secure Shell erreichbar zu machen.

    Speicherplatz ist genügend vorhanden:

    Last config change Wed Apr 27 20:51:38 UTC 2016
    State table size
    0% (79/403000) Show states
    MBUF Usage
    1% 1526/250432
    Load average
    0.09, 0.11, 0.05
    CPU usage
    2%
    Memory usage
    6% of 4030 MiB
    Disk usage ( / )
    29% of 1.8GiB - ufs
    Disk usage ( /cf )
    7% of 49MiB - ufs
    Disk usage ( /tmp )
    0% of 38MiB - ufs in RAM
    Disk usage ( /var )
    35% of 58MiB - ufs in RAM

    Log:

    Jun 3 07:09:05 php-fpm 53685 /pkg_mgr_install.php: New alert found: Unable to open /cf/conf/config.xml for writing in write_config()
    Jun 3 07:09:05 php-fpm 53685 /pkg_mgr_install.php: WARNING: Config contents could not be saved. Could not open file!
    Jun 3 07:08:11 php-fpm 31541 /pkg_mgr_install.php: New alert found: Unable to open /cf/conf/config.xml for writing in write_config()
    Jun 3 07:08:11 php-fpm 31541 /pkg_mgr_install.php: WARNING: Config contents could not be saved. Could not open file!
    Jun 3 06:42:33 php-fpm 48632 /rc.restart_webgui: Creating rrd update script
    Jun 3 06:42:31 check_reload_status webConfigurator restart in progress
    Jun 3 06:42:31 php-fpm 74011 /system_advanced_admin.php: webConfigurator configuration has changed. Restarting webConfigurator.
    Jun 3 06:42:29 xinetd 17313 Reconfigured: new=0 old=1 dropped=0 (services)
    Jun 3 06:42:29 xinetd 17313 readjusting service 6969-udp
    Jun 3 06:42:29 xinetd 17313 Swapping defaults
    Jun 3 06:42:29 xinetd 17313 Starting reconfiguration
    Jun 3 06:42:29 login login on ttyu0 as root
    Jun 3 06:42:28 check_reload_status Reloading filter
    Jun 3 06:42:28 php-fpm 74011 /system_advanced_admin.php: New alert found: Unable to open /cf/conf/config.xml for writing in write_config()
    Jun 3 06:42:28 php-fpm 74011 /system_advanced_admin.php: WARNING: Config contents could not be saved. Could not open file!
    Jun 3 06:38:58 php-fpm 87315 /index.php: Successful login for user 'xy' from: 10.0.0.199
    Jun 3 06:38:53 php-fpm 87315 /index.php: Session timed out for user 'xy' from: 10.0.0.199
    Jun 2 09:55:20 php-fpm 7166 /pkg_mgr_install.php: New alert found: Unable to open /cf/conf/config.xml for writing in write_config()
    Jun 2 09:55:20 php-fpm 7166 /pkg_mgr_install.php: WARNING: Config contents could not be saved. Could not open file!
    Jun 2 09:54:02 php-fpm 74978 /index.php: Successful login for user 'xy' from: 10.0.0.199
    Jun 1 13:46:28 root rc.update_bogons.sh is ending the update cycle.
    Jun 1 13:46:28 root Bogons V6 file downloaded: 204 addresses deleted.
    Jun 1 13:46:28 root Bogons V6 file downloaded: 1191 addresses added.
    Jun 1 13:46:20 root Bogons V4 file downloaded: 38 addresses deleted.
    Jun 1 13:46:20 root Bogons V4 file downloaded: 35 addresses added.
    Jun 1 13:46:15 root rc.update_bogons.sh is beginning the update cycle.
    Jun 1 03:01:00 root rc.update_bogons.sh is sleeping for 38715
    Jun 1 03:01:00 root rc.update_bogons.sh is starting up.

    Folgende Meldung erhalte ich sobald ich das Firmware Update starte:

    Warning: copy(/cf/conf/backup/config-1461790298.xml): failed to open stream: Read-only file system in /etc/inc/config.lib.inc on line 920 Call Stack: 0.0006 233416 1. {main}() /usr/local/www/pkg_mgr_install.php:0 0.1614 1595560 2. write_config() /usr/local/www/pkg_mgr_install.php:451 0.1617 1595960 3. backup_config() /etc/inc/config.lib.inc:553 0.1629 1596432 4. copy() /etc/inc/config.lib.inc:920 Warning: filesize(): stat failed for /cf/conf/backup/config-1461790298.xml in /etc/inc/config.lib.inc on line 927 Call Stack: 0.0006 233416 1. {main}() /usr/local/www/pkg_mgr_install.php:0 0.1614 1595560 2. write_config() /usr/local/www/pkg_mgr_install.php:451 0.1617 1595960 3. backup_config() /etc/inc/config.lib.inc:553 0.1646 1602176 4. filesize() /etc/inc/config.lib.inc:927 Warning: fopen(/cf/conf/backup/backup.cache): failed to open stream: Read-only file system in /etc/inc/config.lib.inc on line 928 Call Stack: 0.0006 233416 1. {main}() /usr/local/www/pkg_mgr_install.php:0 0.1614 1595560 2. write_config() /usr/local/www/pkg_mgr_install.php:451 0.1617 1595960 3. backup_config() /etc/inc/config.lib.inc:553 0.1656 1602568 4. fopen() /etc/inc/config.lib.inc:928 Warning: fwrite() expects parameter 1 to be resource, boolean given in /etc/inc/config.lib.inc on line 929 Call Stack: 0.0006 233416 1. {main}() /usr/local/www/pkg_mgr_install.php:0 0.1614 1595560 2. write_config() /usr/local/www/pkg_mgr_install.php:451 0.1617 1595960 3. backup_config() /etc/inc/config.lib.inc:553 0.1666 1603680 4. fwrite() /etc/inc/config.lib.inc:929 Warning: fclose() expects parameter 1 to be resource, boolean given in /etc/inc/config.lib.inc on line 930 Call Stack: 0.0006 233416 1. {main}() /usr/local/www/pkg_mgr_install.php:0 0.1614 1595560 2. write_config() /usr/local/www/pkg_mgr_install.php:451 0.1617 1595960 3. backup_config() /etc/inc/config.lib.inc:553 0.1675 1602552 4. fclose() /etc/inc/config.lib.inc:930 Warning: fopen(/cf/conf/config.xml.53685): failed to open stream: Read-only file system in /etc/inc/config.lib.inc on line 495 Call Stack: 0.0006 233416 1. {main}() /usr/local/www/pkg_mgr_install.php:0 0.1614 1595560 2. write_config() /usr/local/www/pkg_mgr_install.php:451 0.2666 1647856 3. safe_write_file() /etc/inc/config.lib.inc:565 0.2666 1648048 4. fopen() /etc/inc/config.lib.inc:495

    Die Pfsense funktioniert noch problemlos, leider kann ich nichts mehr ändern in der config. Könnte sein das dass File defekt ist, der Speicher wirds ja kaum sein sonst würde die Firewall nicht mehr booten.

    Wie kann ich das feststellen?

    Falls jemand mehr infos braucht nur fragen, ich bin um jeden Tipp dankbar.



  • Kannst du in Diagnostics > NanoBSD auf "Read/Write" umschalten?



  • So sind die Settings momentan gesetzt:

    Sobald ich auf "Kepp Media mounted read/write at all times" umstelle erhalte ich folgende Fehlermeldung:

    Warning: copy(/cf/conf/backup/config-1461790298.xml): failed to open stream: Read-only file system in /etc/inc/config.lib.inc on line 920 Call Stack: 0.0002 233576 1. {main}() /usr/local/www/diag_nanobsd.php:0 0.2358 1413688 2. write_config() /usr/local/www/diag_nanobsd.php:134 0.2361 1414088 3. backup_config() /etc/inc/config.lib.inc:553 0.2366 1414352 4. copy() /etc/inc/config.lib.inc:920 Warning: filesize(): stat failed for /cf/conf/backup/config-1461790298.xml in /etc/inc/config.lib.inc on line 927 Call Stack: 0.0002 233576 1. {main}() /usr/local/www/diag_nanobsd.php:0 0.2358 1413688 2. write_config() /usr/local/www/diag_nanobsd.php:134 0.2361 1414088 3. backup_config() /etc/inc/config.lib.inc:553 0.2384 1420344 4. filesize() /etc/inc/config.lib.inc:927 Warning: fopen(/cf/conf/backup/backup.cache): failed to open stream: Read-only file system in /etc/inc/config.lib.inc on line 928 Call Stack: 0.0002 233576 1. {main}() /usr/local/www/diag_nanobsd.php:0 0.2358 1413688 2. write_config() /usr/local/www/diag_nanobsd.php:134 0.2361 1414088 3. backup_config() /etc/inc/config.lib.inc:553 0.2393 1420760 4. fopen() /etc/inc/config.lib.inc:928 Warning: fwrite() expects parameter 1 to be resource, boolean given in /etc/inc/config.lib.inc on line 929 Call Stack: 0.0002 233576 1. {main}() /usr/local/www/diag_nanobsd.php:0 0.2358 1413688 2. write_config() /usr/local/www/diag_nanobsd.php:134 0.2361 1414088 3. backup_config() /etc/inc/config.lib.inc:553 0.2403 1421872 4. fwrite() /etc/inc/config.lib.inc:929 Warning: fclose() expects parameter 1 to be resource, boolean given in /etc/inc/config.lib.inc on line 930 Call Stack: 0.0002 233576 1. {main}() /usr/local/www/diag_nanobsd.php:0 0.2358 1413688 2. write_config() /usr/local/www/diag_nanobsd.php:134 0.2361 1414088 3. backup_config() /etc/inc/config.lib.inc:553 0.2412 1420744 4. fclose() /etc/inc/config.lib.inc:930 Warning: fopen(/cf/conf/config.xml.93872): failed to open stream: Read-only file system in /etc/inc/config.lib.inc on line 495 Call Stack: 0.0002 233576 1. {main}() /usr/local/www/diag_nanobsd.php:0 0.2358 1413688 2. write_config() /usr/local/www/diag_nanobsd.php:134 0.3402 1465744 3. safe_write_file() /etc/inc/config.lib.inc:565 0.3403 1465936 4. fopen() /etc/inc/config.lib.inc:495


  • Moderator

    Beim reboot mal die Bootmeldungen mitloggen/beobachten, es könnte sein, dass das Dateisystem beschädigt ist und deshalb nur read-only gemountet ist, obwohl da eigentlich in der Diagnose read/write steht. Ansonsten mal versuchen erst in dem Screen Switch to R/O zu machen und danach wieder R/W (sollte dann ja gehen)?



  • @JeGr:

    Ansonsten mal versuchen erst in dem Screen Switch to R/O zu machen und danach wieder R/W (sollte dann ja gehen)?

    Das hat mein Problem gelöst. Manchmal ist es so einfach. 8) Danke für die Hilfe. Ich kann nun wieder Regeln erstellen und habe soeben das Firmware update erfolgreich durchgeführt.