SRX

Expand all | Collapse all

test config terminal syntax error on }

Jump to Best Answer
  • 1.  test config terminal syntax error on }

    Posted 10-19-2019 14:07

    I loaded a config in Notepad++ and cut/paste into the terminal and got:

     

    > test configuration terminal
    [Type ^D at a new line to end input]
    
    ## Last changed: 2019-08-30 05:57:27 GMT-8
    version 12.1X44-D35.5;
    ...
    terminal:359:(9) error recovery ignores input until this point: }
      [edit security zones security-zone data43]
        '}'
          error recovery ignores input until this point
        policies {
            from-zone core to-zone Internet {
                policy All_core_Internet {
                    match {
                        source-address any;
                        destination-address any;
                        application any;
                    }
                    then {
                        permit;
                    }
                }
            }
    ...
        phone44 {
            vlan-id 442;
        }
    }
    terminal:551:(1) error recovery ignores input until this point: }
      [edit security]
        '}'
          error recovery ignores input until this point
    terminal:551:(0) syntax error: }
      [edit security]
        ''
          syntax error
    error: configuration syntax failed

    Seemingly I have an error with a curly bracket, or is it something else? I tried replacing tabs with spaces. I'm pasting into a Mac terminal using screen.



  • 2.  RE: test config terminal syntax error on }

    Posted 10-19-2019 22:45

    Hello,

     


    @silverst8p wrote:

    Seemingly I have an error with a curly bracket, or is it something else? I tried replacing tabs with spaces. I'm pasting into a Mac terminal using screen.


     

    You have likely made an error with missing curly bracket _AND_ possibly something else but this "something else" won't be discovered by JUNOS syntax checker until You fix that curly bracket error and re-run "test configuration terminal".

    As a side note, copy-pasting big text blocks into telnet/ssh terminal is always a source of funny errors because chars can get missing in transit without You noticing, due to telnet/ssh server not keeping up with pace of incoming information. To minimise possibility of this happening, configure char send delay + line send delay in Your terminal emulator program (SecureCRT supports it, Putty does not).

    HTH

    Thx

    Alex

     

     



  • 3.  RE: test config terminal syntax error on }

    Posted 10-21-2019 11:16

    Yeah, Mac iterm2 seems to have an option in Edit > Paste Special > Paste Slowly, maybe I'll try that. Weird it worked the other day without doing this. Meanwhile, I can't really tell which } it doesn't like, so I've identified and isolated the code blocks I want to updated in a separate window, and will just try to manually change them when I get onsite to the unit I'm testing.

     

    I have a shelf spare unit on my test bench where I test code, then go to the production site and try to upload/commit code. When the upload/commit option on the GUI fails, I drop to the terminal to try to make it work. I figured some kind of encoding was causing problems in translation.

     

    Is there some online way to test candidate configs to check for errors before pushing to a real box?



  • 4.  RE: test config terminal syntax error on }

    Posted 10-21-2019 19:58

    Hello,

     


    @silverst8p wrote:

     

    Is there some online way to test candidate configs to check for errors before pushing to a real box?


     

    Your options here are:

    1/ vSRX on own server, in AWS or Azure cloud - but then interface names & numbers are going to be different, AFAIK 

    2/ Juniper vLabs https://jlabs.juniper.net/vlabs/

    3/ build own JUNOS simulator 

     

    HTH

    Thx

    Alex



  • 5.  RE: test config terminal syntax error on }
    Best Answer

     
    Posted 10-22-2019 02:59

    When you have large sets of commands to load then using the file method rather than terminal is generally more reliable.  Simply copy your plain text command file up to the device and load it from the cli by specifying the path and name instead of terminal.

     



  • 6.  RE: test config terminal syntax error on }

    Posted 10-25-2019 09:01

    @aarseniev, thanks, I'm looking around the vLabs now, looks interesting.

     

    @spuluka, I'm not quite sure how to cut/paste directly to a file on the unit over the terminal, but I'll look it up, I thought the only way to get a file to the unit was tftp or some such... I also have to figure out if it will tell you specific problems if the file you're loading has commit errors.



  • 7.  RE: test config terminal syntax error on }

     
    Posted 10-26-2019 10:20

    Sorry for not being clear.  the file load method requires that a file with your configuration or set commands is copied to the device.

     

    When SSH is enabled you can simply use scp to copy the file onto the device.  Or you can enable ftp and use that protocol.

     

    Once the file is present if it is a config file you use the normal

    load /path/filename

    If you file has set commands listed as if run on the cli use

    load set /path/filename

     

    The merge, replace and update options for load also are allowed with file source.