[rancid] Re: Has anybody solved the extreme "unsaved changes" bug?

john heasley heas at shrubbery.net
Thu May 6 16:51:33 UTC 2010


Mon, May 03, 2010 at 07:58:02AM +1200, David Young:
> Hi John,
> 
> We are using rancid 2.3.3, with expect 5.43
> 
> I believe this is the problem:
> 
> I run "xrancid -d myswitch.local":
> 
> executing clogin -t 90 -c "show version;show memory;show diag;show
> switch;show slot;show configuration detail;show configuration"
> myswitch.local
> 
> couldn't compile regular expression pattern: quantifier operand invalid
>     while executing
> "expect -nobrace -re {* myswitch.local([^#>\r\n]+)?[#>](\([^)\r\n]+\))?}
> {} -re {[
> ]+} { exp_continue }"
>     invoked from within
> "expect {
> 	    -re $reprompt	{}
> 	    -re "\[\n\r]+"	{ exp_continue }
> 	}"
>     (procedure "run_commands" line 21)
>     invoked from within
> "run_commands $prompt $command"
>     ("foreach" body line 155)
>     invoked from within
> "foreach router [lrange $argv $i end] {
>     set router [string tolower $router]
>     # attempt at platform switching.
>     set platform ""
>     send_user ..."
>     (file "/usr/bin/clogin" line 722)
> 
> I tried to run the two prompt variations within expect itself, not sure
> if the second result is what I _should_ be getting, but certainly the
> asterisk makes a difference:
> 
> 
> expect1.2> expect -nobrace -re {*
> myswitch.local([^#>\r\n]+)?[#>](\([^)\r\n]+\))?} {} -re "\[\n\r]+"	{
> exp_continue }
> couldn't compile regular expression pattern: quantifier operand invalid
>     while executing
> "expect -nobrace -re {* myswitch.local([^#>\r\n]+)?[#>](\([^)\r\n]+\))?}
> {} -re "\[\n\r]+"	{ exp_continue }"
> 
> expect1.3> expect -nobrace -re{
> myswitch.local([^#>\r\n]+)?[#>](\([^)\r\n]+\))?} {} -re "\[\n\r]+"	{
> exp_continue }
> +>
> 
> I have attached the output of clogin -d -c 'show version' myswitch.local
> (I have obfuscated the switch name and IP). It seems to die abruptly,
> the last line outputted is "expect: set expect_out(buffer) "\tmirroring
> multin"

could you show the o/p of "clogin -c 'show version' host" to me?  ie: the
match of the clogin -d o/p below.

> Thanks for the assistance!
> David
> 
> 
> 
> On 23/04/10 11:49 AM, john heasley wrote:
> > Fri, Apr 23, 2010 at 10:21:42AM +1200, David Young:
> >> Hi all,
> >>
> >> I refer to this issue:
> >>
> >> http://www.shrubbery.net/pipermail/rancid-discuss/2009-January/003614.html
> >>
> >> It seems that running RANCID against an extreme switch puts it into an
> >> "unsaved" state (maybe because of the clipaging?), and so while the
> >> first run is successful, any subsequent runs fail because of the
> >> asterisk in the prompt...
> >>
> >> i.e.:
> >>
> >>>> "expect -nobrace -re {* 300e48-x.([^#>\r\n]+)?[#>](\([^)\r\n]+\))?}
> >> {} -re {[
> >>>> ^M]+} { exp_continue }"
> > 
> > this should work; it used to.  we have one for testing but its not up yet.
> > send the o/p of clogin -d -s 'show version' host >log 2>&1.  that should
> > identify the issue.
> > 
> > i'd first make sure that you're using expect >= 5.43 and rancid 2.3.3.

> [rancid at stats ~]$ clogin -d -c 'show version' myswitch.local 
> myswitch.local
> spawn telnet myswitch.local
> parent: waiting for sync byte
> parent: telling child to go ahead
> parent: now unsynchronized from child
> spawn: returns {810}
> 
> expect: does "" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
> 
> expect: does "" (spawn_id exp6) match glob pattern "unknown host\r"? no
> 
> expect: does "" (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> ">"? no
> "Login invalid"? no
> Trying 192.168.23.12...
> Connected to myswitch.local (192.168.23.12).
> Escape character is '^]'.
> 
> expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
> 
> expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n" (spawn_id exp6) match glob pattern "unknown host\r"? no
> 
> expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n" (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> ">"? no
> "Login invalid"? no
> 
> Copyright (C) 1999 by  Extreme Networks
> login: 
> expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by  Extreme Networks\r\r\nlogin: " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
> 
> expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by  Extreme Networks\r\r\nlogin: " (spawn_id exp6) match glob pattern "unknown host\r"? no
> 
> expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by  Extreme Networks\r\r\nlogin: " (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? yes
> expect: set expect_out(0,string) "login:"
> expect: set expect_out(1,string) "login"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by  Extreme Networks\r\r\nlogin:"
> send: sending "admin\r" to { exp6 }
> expect: continuing expect
> 
> expect: does " " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
> 
> expect: does " " (spawn_id exp6) match glob pattern "unknown host\r"? no
> 
> expect: does " " (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> ">"? no
> "Login invalid"? no
> admin
> password: 
> expect: does " admin\r\npassword: " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
> 
> expect: does " admin\r\npassword: " (spawn_id exp6) match glob pattern "unknown host\r"? no
> 
> expect: does " admin\r\npassword: " (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? yes
> expect: set expect_out(0,string) "password:"
> expect: set expect_out(1,string) "password"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) " admin\r\npassword:"
> send: sending "n5wf5nz#\r" to { exp6 }
> expect: continuing expect
> 
> expect: does " " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
> 
> expect: does " " (spawn_id exp6) match glob pattern "unknown host\r"? no
> 
> expect: does " " (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> ">"? no
> "Login invalid"? no
> 
> 
> Press the <tab> key at any time for completions.
> Don't forget to save your configuration change
> expect: does " \r\n\r\nPress the <tab> key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
> "(Connection closed by|Connection to [^\n\r]+ closed)"? no
> 
> expect: does " \r\n\r\nPress the <tab> key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match glob pattern "unknown host\r"? no
> 
> expect: does " \r\n\r\nPress the <tab> key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match glob pattern "Host is unreachable"? no
> "No address associated with name"? no
> "(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
> "HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
> "Offending key for .* (yes/no)?"? no
> "(denied|Sorry)"? no
> "Login failed"? no
> "% (Bad passwords|Authentication failed)"? no
> "Press any key to continue"? no
> "Enter Selection: "? no
> "Last login:"? no
> "@[^\r\n]+ ([Pp]assword|passwd):"? no
> "(Username|Login|login|user name|User):"? no
> "([Pp]assword|passwd):"? no
> ">"? yes
> expect: set expect_out(0,string) ">"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) " \r\n\r\nPress the <tab>"
> send: sending "enable\r" to { exp6 }
> 
> expect: does " key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match regular expression "(Username|Login|login|user name|User):"? no
> "[Pp]assword:"? no
> "#"? no
> "(enable)"? no
> "(denied|Sorry|Incorrect)"? no
> "% Error in authentication"? no
> "% Bad passwords"? no
> s.
> * switch2-na:1 # 
> expect: does " key at any time for completions.\r\nDon't forget to save your configuration changes.\r\n* switch2-na:1 # " (spawn_id exp6) match regular expression "(Username|Login|login|user name|User):"? no
> "[Pp]assword:"? no
> "#"? yes
> expect: set expect_out(0,string) "#"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) " key at any time for completions.\r\nDon't forget to save your configuration changes.\r\n* switch2-na:1 #"
> send: sending "\r" to { exp6 }
> 
> expect: does " " (spawn_id exp6) match regular expression "[\r\n]+"? no
> "^(.+[:.])1 (#)"? no
> "^.+#"? no
> enable
> 
> Syntax error at end of line.
> 
> Next possible completions:
> 	autodst bootp bootprelay cli-
> expect: does " enable\r\n\r\nSyntax error at end of line.\r\n\r\nNext possible completions:\r\n\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) " enable\r\n\r\n"
> expect: continuing expect
> 
> expect: does "Syntax error at end of line.\r\n\r\nNext possible completions:\r\n\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "Syntax error at end of line.\r\n\r\n"
> expect: continuing expect
> 
> expect: does "Next possible completions:\r\n\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "Next possible completions:\r\n"
> expect: continuing expect
> 
> expect: does "\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? no
> "^(.+[:.])1 (#)"? no
> "^.+#"? no
> config-logging clipaging 
> 	dvmrp edp esrp gvrp icmp 
> 	idletimeouts igmp ignore-stp iparp ipforwarding 
> 	ipmcforwarding iproute isq ipxrip ipxsap 
> 	jumbo irdp learning license log 
> 	mirroring multinetting ospf pace pim-dm 
> 	ports qosmonitor radius rip rmon 
> 	sharing smartredundancy snmp sntp-client stpd 
> 	subvlan-proxy-arp summitlink syslog telnet type20 
> 	web <spanning tree name> 
> * switch2-na:2 # 
> expect: does "\tautodst bootp bootprelay cli-config-logging clipaging \r\n\tdvmrp edp esrp gvrp icmp \r\n\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "\tautodst bootp bootprelay cli-config-logging clipaging \r\n"
> expect: continuing expect
> 
> expect: does "\tdvmrp edp esrp gvrp icmp \r\n\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "\tdvmrp edp esrp gvrp icmp \r\n"
> expect: continuing expect
> 
> expect: does "\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n"
> expect: continuing expect
> 
> expect: does "\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "\tipmcforwarding iproute isq ipxrip ipxsap \r\n"
> expect: continuing expect
> 
> expect: does "\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "\tjumbo irdp learning license log \r\n"
> expect: continuing expect
> 
> expect: does "\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
> expect: set expect_out(0,string) "\r\n"
> expect: set expect_out(spawn_id) "exp6"
> expect: set expect_out(buffer) "\tmirroring multin[rancid at stats ~]$


More information about the Rancid-discuss mailing list