Description

this article describes the issue of Commit failure with the error message- 'error configjuniper.conf+ write failed Broken pipe'.

Symptoms

 Some customers have faced an issue when performing commit in SRX Branch. How to troubleshoot this issue?

Solution

 Most of time, This issue is caused by SRX being unable to write configs to the /config folder. To resolve this issue, perform the following procedure:

  1. Check whether the /config folder is successfully mounted:

    root# run show system storage
    Filesystem Size Used Avail Capacity Mounted on
    /dev/da0s1a 293M 217M 53M 80% /
    devfs 1.0K 1.0K 0B 100% /dev
    /dev/md0 591M 591M 0B 100% /junos
    /cf 293M 217M 53M 80% /junos/cf
    devfs 1.0K 1.0K 0B 100% /junos/dev/
    procfs 4.0K 4.0K 0B 100% /proc
    /dev/md1 168M 17M 137M 11% /mfs
    /cf/var/jail 293M 217M 53M 80% /jail/var
    /cf/var/log 293M 217M 53M 80% /jail/var/log
    devfs 1.0K 1.0K 0B 100% /jail/dev
    /dev/md2 39M 4.0K 36M 0% /mfs/var/run/utm
    /dev/md3 1.8M 4.0K 1.7M 0% /jail/mfs

    It was found that there are no /config and /cf/var folders mounted. This could cause the failure of writing configs to the /config folder.


  • Mount the /config and /cf/var folders:

    By default, /config and /cf/var should be mounted to /dev/bo0s3e and /dev/bo0s3f :

    /dev/bo0s3e 24M 56K 22M 0% /config
    /dev/bo0s3f 342M 41M 274M 13% /cf/var

    root@SRX240-a% ls -l /dev
    total 1
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:02 altroot -> da0s2a
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:00 bo0s1a -> da0s1a
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:00 bo0s1c -> da0s1c
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:00 bo0s3c -> da0s3c
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:00 bo0s3e -> da0s3e
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:00 bo0s3f -> da0s3f
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:00 bo0s4a -> da0s4a
    lrwxr-xr-x 1 root wheel 6 Aug 30 16:00 bo0s4c -> da0s4c

  • It was found that bo0s3e and bo0s3f link to da0s3e and da0s3f . Check these two partition in /dev :

    root@SRX240-a% ls /dev
    altroot cfi0 da0s4
    bo0s1a console da0s4a
    bo0s1c cpld da0s4c
    bo0s3c ctty devctl
    bo0s3e cuau0 devstat
    bo0s3f cuau0.init fd
    bo0s4a cuau0.lock fido
    bo0s4c da0 fileassoc
    bpf0 da0s1 gblmem
    bpf1 da0s1a geom.ctl
    bpf2 da0s1c gpio
    bpf3 da0s2 klog
    bpf4 da0s2a kmem
    bpf5 da0s2c log
    bpf6 da0s3 ..........
    bpf7 da0s3c

    It was found that there is no da0s3e and da0s3f . This should be caused by the partition info in da0s3 being destroyed. We need to restore this partition.

  • Restore da0s3e and da0s3f partition:

    root@SRX240-a% bsdlabel -w da0s3 ------>(to write label with existing boot program)
    root@SRX240-a% bsdlabel -e da0s3 ------>(to edit label)
    # /dev/da0s3:
    8 partitions:
    # size offset fstype [fsize bsize bps/cpg]
    c: 763904 0 unused 0 0 # "raw" part, don't edit
    e: 50944 256 4.2BSD 2048 16384 3184
    f: 712704 51200 4.2BSD 2048 16384 44544

    To restore the da0s3 partition, edit the info correctly and save.

    Note : the da0s3 info is correct with 1G flash card; different flash cards have different info. So please refer to the other SRX device with the same size flash card info to edit this.

  • After this operation, if the da0s3's partition is correct, we then need to check the fstab info for SRX auto mount when the next reboot occurs:

    root@SRX240-a% cat /etc/fstab
    # Device Mountpoint FStype Options Dump Pass#
    /dev/md0 / cd9660 ro 0 0
    proc /proc procfs rw 0 0
    /dev/bo0s3e /config ufs rw,noauto 2 0
    /dev/bo0s3f /cf/var ufs rw,noauto 2 0
    /dev/altroot /altroot ufs rw,noauto 2 0
    /dev/bo0s1b none swap sw 0 0

    Note : this info differs, if the platform or version or flash card size is different; please refer to other SRX device to edit.

  • Recreate the file system for these two partitions with newfs /dev/da0s3e and newfs /dev/da0s3f .

  • Reboot SRX, check whether the /dev da0s3 partition is correct, and check whether /config and /cf/var have been mounted successfully.