RicardoGustavo / neatx

Automatically exported from code.google.com/p/neatx
0 stars 0 forks source link

ValueError: invalid literal for int() with base 10: '1:3' #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install from source svn revision 9
2. Install nxclient and nxnode (latest)
3. Try to connect

What is the expected output? What do you see instead?

I expect no errors, but the following error appears in syslog:

Jul  8 23:49:35 descent nxserver-login[19310]: ERROR Caught exception
Jul  8 23:49:35 descent nxserver-login[19310]: Traceback (most recent call 
last):
Jul  8 23:49:35 descent nxserver-login[19310]:   File "/usr/lib/python2.6/
dist-packages/neatx/cli.py", line 62, in Main
Jul  8 23:49:35 descent nxserver-login[19310]:     self.Run()
Jul  8 23:49:35 descent nxserver-login[19310]:   File "/usr/lib/python2.6/
dist-packages/neatx/app/nxserver_login.py", line 288, in Run
Jul  8 23:49:35 descent nxserver-login[19310]:     LoginServer
(self.cfg).Start()
Jul  8 23:49:35 descent nxserver-login[19310]:   File "/usr/lib/python2.6/
dist-packages/neatx/protocol.py", line 135, in Start
Jul  8 23:49:35 descent nxserver-login[19310]:     self.SendBanner()
Jul  8 23:49:35 descent nxserver-login[19310]:   File "/usr/lib/python2.6/
dist-packages/neatx/app/nxserver_login.py", line 280, in SendBanne
Jul  8 23:49:35 descent nxserver-login[19310]:     utils.FormatVersion
(self._cfg.nx_protocol_version, ".",
Jul  8 23:49:35 descent nxserver-login[19310]:   File "/usr/lib/python2.6/
dist-packages/neatx/config.py", line 137, in _GetNxProtocolVersion
Jul  8 23:49:35 descent nxserver-login[19310]:     
constants.PROTOCOL_VERSION_DIGITS)
Jul  8 23:49:35 descent nxserver-login[19310]:   File "/usr/lib/python2.6/
dist-packages/neatx/utils.py", line 820, in ParseVersion
Jul  8 23:49:35 descent nxserver-login[19310]:     value = int(parts[idx])
Jul  8 23:49:35 descent nxserver-login[19310]: ValueError: invalid literal 
for int() with base 10: '1:3'

What version of the product are you using? On what operating system?
ubuntu 9.04 x86-64

Please provide any additional information below.
I fixed this by changing 
File "/usr/lib/python2.6/dist-packages/neatx/utils.py", line 820 to 
value = 13

Original issue reported on code.google.com by descentspb@gmail.com on 8 Jul 2009 at 8:11

GoogleCodeExporter commented 8 years ago
Try adding ":" to constants.NXAGENT_VERSION_SEP:
NXAGENT_VERSION_SEP = ".-~:"

If this doesn't help, what's the output of constants.NXAGENT_VERSION_COMMAND 
(the
command is most likely “dpkg-query -W --showformat='${Version}' nxagent”)?

Original comment by ims...@gmail.com on 9 Jul 2009 at 9:47

GoogleCodeExporter commented 8 years ago
Have the same problema, edited 
/usr/lib/python2.6/dist-packages/neatx/constants.py
and back work! :-)

Anyone can commit this change !? 

Original comment by lucmult@gmail.com on 9 Jul 2009 at 3:10

GoogleCodeExporter commented 8 years ago
Ah. I see the issue:

# dpkg-query -W --showformat='${Version}' nxagent
1:3.3.0-6-0ubuntu1~hardy1

It looks like that version detection really is just too fragile

Original comment by kormat on 9 Jul 2009 at 6:54

GoogleCodeExporter commented 8 years ago
The fix is to manually set the nx protocol version (e.g. 3.3.0) in neatx.conf:

[global]
nx-protocol-version = 3.3.0

Original comment by kormat on 9 Jul 2009 at 6:55

GoogleCodeExporter commented 8 years ago
this one does not help:
[global]
nx-protocol-version = 3.3.0

still got the error. The hack for me was to change the command from

dpkg-query -W --showformat='${Version}' nxagent
to 
echo 3.3.0 :)

Original comment by descentspb@gmail.com on 9 Jul 2009 at 10:04

GoogleCodeExporter commented 8 years ago
Hey, I committed a fix to make the nx-protocol-version config entry be parsed 
properly, i'm wondering if it means you don't need to do the "echo 3.3.0" 
thing. If 
you get a chance to test, let me know. Thanks.

Original comment by kormat on 14 Jul 2009 at 9:56

GoogleCodeExporter commented 8 years ago
In constants.py, why not detect nx version the same way that freenx does? It 
would be
more generic than finding the correct line for dpkg, rpm, pacman, equery (in my
case). Something like this works fine here:
NXAGENT_VERSION_COMMAND = ("strings %s|grep 'NXAGENT - Version' | sed -e
's/[^0-9.]*//'" % NXAGENT_PKGNAME)

Original comment by bcafa...@gmail.com on 18 Jul 2009 at 12:35

GoogleCodeExporter commented 8 years ago
The reason we haven't done that is because it's horrible -)

Original comment by kormat on 20 Jul 2009 at 5:06

GoogleCodeExporter commented 8 years ago
Hi, I also use a current check-out on Ubuntu.

dpkg-query -W --showformat='${Version}' nxagent
1:3.3.0-6-0ubuntu1

and it doesn’t work

Started
2009-07-22 17:29:39,926: nxserver-login pid=31777 ERROR Caught exception
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/neatx/cli.py", line 58, in Main
    self.cfg = config.Config(constants.CONFIG_FILE)
  File "/usr/lib/python2.6/dist-packages/neatx/config.py", line 119, in __init__
    constants.PROTOCOL_VERSION_DIGITS)
  File "/usr/lib/python2.6/dist-packages/neatx/utils.py", line 815, in ParseVersion
    parts = split_fn(version)
  File "/usr/lib/python2.6/dist-packages/neatx/utils.py", line 769, in <lambda>
    return lambda ver: re_split(ver, count)[:count]
TypeError: expected string or buffer
EOF on stderr, exiting

The « 1: » in the front is the epoch. cf. 
http://www.debian.org/doc/debian-policy/ch-
controlfields.html#s-f-Version

Original comment by towolf on 22 Jul 2009 at 3:52

GoogleCodeExporter commented 8 years ago
Yeah, basically the auto-version-detection is badly broken. The best thing to 
do (and
hence it's in the INSTALL file) is to manually set the nx protocol version in 
neatx.conf.

Original comment by kormat on 22 Jul 2009 at 4:28

GoogleCodeExporter commented 8 years ago
Oops, actually INSTALL doesn't say that, what i did instead was make the 
example conf
contain the correct setting. I've just sent a patch to remove the automatic 
version
detection, which should fix this permanently. 

Original comment by kormat on 22 Jul 2009 at 4:42

GoogleCodeExporter commented 8 years ago
Patch committed. The protocol version now defaults to 3.3.0 (see 
lib/constants.py), 
and is overridable via neatx.conf

Original comment by kormat on 27 Jul 2009 at 9:29

GoogleCodeExporter commented 8 years ago
Hi,
this traceback is still present on Fedora 11 although all places that mention
protocol version have the same value. nx package is nxagent for fedora. I'm 
using svn
revision 40. 

# rpm -q nx
nx-3.3.0-35.fc11.i586

# grep protocol /etc/neatx.conf
nx-protocol-version = 3.3.0

# grep protocol -i /usr/lib/python2.6/site-packages/neatx/constants.py
PROTOCOL_VERSION_DIGITS = [2, 2, 4]
DEFAULT_NX_PROTOCOL_VERSION = "3.3.0"

Also in lib/constants.py:
NXAGENT_PKGNAME = "nxagent"

This should be only "nx" for Fedora if it matters.

Original comment by alexx.to...@gmail.com on 12 Aug 2009 at 1:29

GoogleCodeExporter commented 8 years ago
My traceback is:

Aug 12 09:20:03 hp-dl585g2-01 nxserver-login-wrapper[20816]: ValueError: invalid
literal for int() with base 10: '0nuse'
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]: 2009-08-12 
09:20:39,630:
nxserver-login pid=20841 ERROR Caught exception
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]: Traceback (most 
recent
call last):
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]:   File
"/usr/lib/python2.6/site-packages/neatx/cli.py", line 58, in Main
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]:     self.cfg =
config.Config(constants.CONFIG_FILE)
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]:   File
"/usr/lib/python2.6/site-packages/neatx/config.py", line 134, in __init__
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]:    
constants.PROTOCOL_VERSION_DIGITS)
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]:   File
"/usr/lib/python2.6/site-packages/neatx/utils.py", line 820, in ParseVersion
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]:     value = 
int(parts[idx])
Aug 12 09:20:39 hp-dl585g2-01 nxserver-login-wrapper[20838]: ValueError: invalid
literal for int() with base 10: '0nuse'

Original comment by alexx.to...@gmail.com on 12 Aug 2009 at 1:30