[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-20 Thread Launchpad Bug Tracker
This bug was fixed in the package nut - 2.6.0-1ubuntu3

---
nut (2.6.0-1ubuntu3) natty; urgency=low

  * debian/patches/backport-fix-lp753661.patch: Backport fix
to trim extraneous end-of-line, in buggy HID string tables,
which results in upsc breaking the communication pipe.
(LP: #753661)
 -- Chuck Short zul...@ubuntu.com   Wed, 20 Apr 2011 10:47:05 -0400

** Changed in: nut (Ubuntu)
   Status: New = Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


Re: [Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-18 Thread Arnaud Quette
so what if you issue again an upsc powercom?
does it still broke the pipe?
is your issue 100 % reproducible?

my guess, is ATM, that the faulty end-of-line marker in battery.type is
causing parseconf to close prematurely the connexion, while upsd is still
sending data.
which explains why unit requests works, while getting the whole tree
fails...
the only way to ensure this is the root cause is to fix the function that
retrieve strings from the device's indexed table, to trim EOL, and check if
it solves your issue.

would you be ready to test a fix using subversion?

cheers,
Arno

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-18 Thread Virus
yes, it 100 % reproducible.

i am ready to test svn version.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


Re: [Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-18 Thread Arnaud Quette
2011/4/18 Virus 753...@bugs.launchpad.net

 yes, it 100 % reproducible.


I also managed to reproduce it using dummy-ups (the simulation driver) and
injecting the error on the same variable:
adding a newline (ie \n) results in a broken pipe on upsc side.


 i am ready to test svn version.


ok, here we go:
1) checkout an svn copy using:
$  svn co svn://svn.debian.org/nut/trunk

2) configure it using (Debian arguments, limited for the current test scope
; should be sufficient):
--prefix=/usr \
--exec-prefix=/ \
--sysconfdir=/etc/nut \
--mandir=/usr/share/man \
--libdir=/lib \
--includedir=/usr/include \
--without-all \
--with-usb \
--enable-static \
--with-statepath=/var/run/nut \
--with-altpidpath=/var/run/nut \
--with-drvpath=/lib/nut \
--with-pidpath=/var/run/nut \
--datadir=/usr/share/nut \
--with-pkgconfig-dir=/usr/lib/pkgconfig \
--with-user=nut --with-group=nut

3) apply the attached patch
$ patch -p0  /path/to/virus.patch

4) make as usual, ie
$ make

5) stop all previous NUT instances, then launch the new driver and upsd
$ sudo drivers/usbhid-ups -a powercom
$ sudo server/upsd -DDD

6) now issue your upsc of death
$ upsc powercom

everything should behave fine.
Remember that it's a blind patch: I've not validated the above configure
line, nor the patch itself!

cheers,
Arnaud
-- 
Linux / Unix Expert RD - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/


** Attachment added: virus.patch
   https://bugs.launchpad.net/bugs/753661/+attachment/2059655/+files/virus.patch

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-18 Thread Virus
It`s working great! Many thanks!

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


Re: [Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-18 Thread Arnaud Quette
2011/4/18 Virus 753...@bugs.launchpad.net

 It`s working great! Many thanks!


excellent, thanks for the feedback.
I've just committed it upstream (r2972)

the changeset will be available on the NUT Trac mirror (just give it some
minutes to sync):
http://trac.networkupstools.org/projects/nut/changeset/2972

I'll leave up to our Ubuntu friends to generate an updated package.
I have to note that importance is low since this should not affect the
protection (ie upsmon is still working fine).
@Virus: can you please confirm this point?

cheers,
Arnaud
-- 
Linux / Unix Expert RD - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-18 Thread Virus
Yeah, upsmon working fine. I was checked it now by unplug power cable.
upsmon was generate alerts UPS powercom@localhost on battery and UPS
powercom@localhost on line power after plug cable back.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


Re: [Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-17 Thread Arnaud Quette
2011/4/16 Virus 753...@bugs.launchpad.net

 $ upsc battery.type
 Error: Unknown UPS
 $ upsc ups.status
 Error: Unknown UPS


damn, I missed a bit (ie the device name):
$ upsc powercom battery.type
Error: Unknown UPS
$ upsc powercom ups.status
Error: Unknown UPS

don't forget to run upsd in debug mode, as in the previous test.
I need to see how it react.

cheers
Arno

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-17 Thread Virus
I was done:
$ for command in battery.charge battery.charge.low battery.charge.warning 
battery
.date battery.runtime battery.type device.mfr device.model device.serial 
device.type driver.name dr
iver.parameter.pollfreq driver.parameter.pollinterval driver.parameter.port 
driver.parameter.produc
tid driver.version driver.version.data driver.version.internal input.frequency 
input.voltage input.
voltage.nominal output.frequency output.voltage output.voltage.nominal 
ups.beeper.status ups.date u
ps.delay.shutdown ups.delay.start ups.load ups.mfr ups.model ups.productid 
ups.serial ups.status up
s.test.result ups.timer.shutdown; do echo -n $command ; upsc powercom 
$command; done

battery.charge 100  
battery.charge.low 10
battery.charge.warning 30
battery.date 2009/12/23
battery.runtime 25600
battery.type PbAc
device.mfr POWERCOM Co.,LTD
device.model HID UPS Battery
device.serial 004-0D9F-000
device.type ups
driver.name usbhid-ups
driver.parameter.pollfreq 30
driver.parameter.pollinterval 2
driver.parameter.port /dev/usb/hiddev0
driver.parameter.productid 0004
driver.version 2.6.0
driver.version.data PowerCOM HID 0.2
driver.version.internal 0.35
input.frequency 50.0
input.voltage 210.0
input.voltage.nominal 220
output.frequency 50.0
input.voltage 210.0
input.voltage.nominal 220
output.frequency 50.0
output.voltage 210.0
output.voltage.nominal 220
ups.beeper.status enabled
ups.date 2009/12/23 
ups.delay.shutdown 20
ups.delay.start 60  
ups.load 7
ups.mfr POWERCOM Co.,LTD
ups.model HID UPS Battery
ups.productid 0004  
ups.serial 004-0D9F-000
ups.status OL
ups.test.result Done and passed
ups.timer.shutdown 0

without any 'Broken pipe'.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Virus
Files

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Virus
Files #2

** Attachment added: upsd -DDD
   
https://bugs.launchpad.net/ubuntu/+source/nut/+bug/753661/+attachment/2047194/+files/upsd.txt

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Virus
Files #3

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Virus
lsusb

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Virus
Attachments not working correctly.


** Attachment added: All files
   
https://bugs.launchpad.net/ubuntu/+source/nut/+bug/753661/+attachment/2047202/+files/files.tar

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Virus
Seems driver respond correctly, but upsd return Broken pipe after:
  25.768861 write: [destfd=6] [len=35] [VAR powercom battery.type PbAc
]

Two lines?

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


Re: [Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Arnaud Quette
2011/4/16 Virus 753...@bugs.launchpad.net

 Seems driver respond correctly, but upsd return Broken pipe after:
  25.768861 write: [destfd=6] [len=35] [VAR powercom battery.type PbAc
 ]

 Two lines?


yup, but upsd sends everything. and upsc brokes the pipe.
the driver is still there, so the issue is really between upsc and upsd.

2 more tests, still with upsd running in debug mode:
$ upsc battery.type
$ upsc ups.status

cheers,
Arno

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011-04-16 Thread Virus
$ upsc battery.type
Error: Unknown UPS
$ upsc ups.status
Error: Unknown UPS

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in Ubuntu.
https://bugs.launchpad.net/bugs/753661

Title:
  upsd write() failed for 127.0.0.1: Broken pipe

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs