Capture Interface fails to start

Bug #1246943 reported by Lars Kruse
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Virtualbricks
Fix Released
Undecided
Unassigned

Bug Description

I tried to setup a capture interface with the following options (taken from the config file):

 [Capture:uplink_eth0]
 pon_vbevent=
 poff_vbevent=
 iface=eth0
 sock=/root/.virtualbricks/uplink.ctl
 name=uplink_eth0

The start of that brick failed with the following message:
 OSError: Brick startup failed. Check your configuration!

Further debugging led to the following command line that was issued during the setup of that brick:
 ['/usr/bin/vde_pcapplug eth0 -s /root/.virtualbricks/uplink.ctl -P /tmp/uplink_eth0.pid', '-s', '/root/.virtualbricks/uplink.ctl']

Above you see that the first three items are concatenated white there are two more (separate) arguments following.
The subprocess module cannot handle this mixture and bascially complains that there is no file with the name of the first list item.

The attached patch does the following:
1) simplify and fix the parameter handling (no more manual string concatenation and escaping) - this fixes the bug
2
) skip the use of "sudo" if it is not necessary (e.g. for root)
3) warn if sudo is required, but not available
4) simplify the parsing of config file strings containing a "=" (e.g. a kernel parameter like "root=/dev/sda")

cheers,
Lars

Revision history for this message
Lars Kruse (devel-sumpfralle) wrote :
Revision history for this message
Francesco Apollonio (lorddex) wrote : Re: [Bug 1246943] [NEW] Capture Interface fails to start
Download full text (3.4 KiB)

Which version of vb are you using? If you are using the last stable, can
you try to use the version vb-debug (you have to download the code using
bzr) instead?

Francesco
Il 01/nov/2013 02:55 "Lars Kruse" <email address hidden> ha scritto:

> Public bug reported:
>
> I tried to setup a capture interface with the following options (taken
> from the config file):
>
> [Capture:uplink_eth0]
> pon_vbevent=
> poff_vbevent=
> iface=eth0
> sock=/root/.virtualbricks/uplink.ctl
> name=uplink_eth0
>
> The start of that brick failed with the following message:
> OSError: Brick startup failed. Check your configuration!
>
> Further debugging led to the following command line that was issued during
> the setup of that brick:
> ['/usr/bin/vde_pcapplug eth0 -s /root/.virtualbricks/uplink.ctl -P
> /tmp/uplink_eth0.pid', '-s', '/root/.virtualbricks/uplink.ctl']
>
> Above you see that the first three items are concatenated white there are
> two more (separate) arguments following.
> The subprocess module cannot handle this mixture and bascially complains
> that there is no file with the name of the first list item.
>
> The attached patch does the following:
> 1) simplify and fix the parameter handling (no more manual string
> concatenation and escaping) - this fixes the bug
> 2) skip the use of "sudo" if it is not necessary (e.g. for root)
> 3) warn if sudo is required, but not available
> 4) simplify the parsing of config file strings containing a "=" (e.g. a
> kernel parameter like "root=/dev/sda")
>
> cheers,
> Lars
>
> ** Affects: virtualbrick
> Importance: Undecided
> Status: New
>
> ** Attachment added: "Fix parameter handling for capture interface"
>
> https://bugs.launchpad.net/bugs/1246943/+attachment/3897245/+files/virtualbricks_capture_interface.patch
>
> --
> You received this bug notification because you are subscribed to
> Virtualbricks.
> https://bugs.launchpad.net/bugs/1246943
>
> Title:
> Capture Interface fails to start
>
> Status in Virtualbricks:
> New
>
> Bug description:
> I tried to setup a capture interface with the following options (taken
> from the config file):
>
> [Capture:uplink_eth0]
> pon_vbevent=
> poff_vbevent=
> iface=eth0
> sock=/root/.virtualbricks/uplink.ctl
> name=uplink_eth0
>
> The start of that brick failed with the following message:
> OSError: Brick startup failed. Check your configuration!
>
> Further debugging led to the following command line that was issued
> during the setup of that brick:
> ['/usr/bin/vde_pcapplug eth0 -s /root/.virtualbricks/uplink.ctl -P
> /tmp/uplink_eth0.pid', '-s', '/root/.virtualbricks/uplink.ctl']
>
> Above you see that the first three items are concatenated white there
> are two more (separate) arguments following.
> The subprocess module cannot handle this mixture and bascially complains
> that there is no file with the name of the first list item.
>
> The attached patch does the following:
> 1) simplify and fix the parameter handling (no more manual string
> concatenation and escaping) - this fixes the bug
> 2) skip the use of "sudo" if it is not necessary (e.g. for root)
> 3) warn if sudo is required, but not a...

Read more...

Revision history for this message
Lars Kruse (devel-sumpfralle) wrote :

Hi Francesco,

sorry for omitting the details ...

I use the debian package 0.6.352-1 - which is probably not quite fresh.
Anyway: the changes still seem to apply to the current code (just different locations).

Now I splitted the patch and uploaded the separate changes to a branch:
 lp:~devel-sumpfralle/virtualbrick/bug_1246943

Maybe you will want to deduplicate your current "needsudo" function (in Events and Bricks).

btw: I was happy to see the tabs being replaced with spaces :)

cheers,
Lars

Revision history for this message
Lars Kruse (devel-sumpfralle) wrote :

Sorry again - I just noticed that you mentioned the vb-debug branch.
My patch branch was based on trunk, which seems to be 300 commits away from vb-debug.
I will take a look at the difference and check, if the patch is still relevant.

Regarding the branch structure: the low-activity trunk branch confuses me. Does it have a specific purpose? Maybe vb-debug deserves a merge?

anyway: keep up the good work!
cheers,
Lars

Revision history for this message
Francesco Apollonio (lorddex) wrote : Re: [Bug 1246943] Re: Capture Interface fails to start

Don't worry I will check in the next days if your patch can be applied in
the vb-debug branch otherwise i'll fix the bug in another way. we are
waiting to finish the work in the vb-debug branch before doing the merge,
but it's only a matter of some weeks so stay tuned!

thank you for your suggestions and your bug reports

Francesco

On 1 November 2013 13:45, Lars Kruse <email address hidden> wrote:

> Sorry again - I just noticed that you mentioned the vb-debug branch.
> My patch branch was based on trunk, which seems to be 300 commits away
> from vb-debug.
> I will take a look at the difference and check, if the patch is still
> relevant.
>
> Regarding the branch structure: the low-activity trunk branch confuses
> me. Does it have a specific purpose? Maybe vb-debug deserves a merge?
>
> anyway: keep up the good work!
> cheers,
> Lars
>
> --
> You received this bug notification because you are subscribed to
> Virtualbricks.
> https://bugs.launchpad.net/bugs/1246943
>
> Title:
> Capture Interface fails to start
>
> Status in Virtualbricks:
> New
>
> Bug description:
> I tried to setup a capture interface with the following options (taken
> from the config file):
>
> [Capture:uplink_eth0]
> pon_vbevent=
> poff_vbevent=
> iface=eth0
> sock=/root/.virtualbricks/uplink.ctl
> name=uplink_eth0
>
> The start of that brick failed with the following message:
> OSError: Brick startup failed. Check your configuration!
>
> Further debugging led to the following command line that was issued
> during the setup of that brick:
> ['/usr/bin/vde_pcapplug eth0 -s /root/.virtualbricks/uplink.ctl -P
> /tmp/uplink_eth0.pid', '-s', '/root/.virtualbricks/uplink.ctl']
>
> Above you see that the first three items are concatenated white there
> are two more (separate) arguments following.
> The subprocess module cannot handle this mixture and bascially complains
> that there is no file with the name of the first list item.
>
> The attached patch does the following:
> 1) simplify and fix the parameter handling (no more manual string
> concatenation and escaping) - this fixes the bug
> 2) skip the use of "sudo" if it is not necessary (e.g. for root)
> 3) warn if sudo is required, but not available
> 4) simplify the parsing of config file strings containing a "=" (e.g. a
> kernel parameter like "root=/dev/sda")
>
> cheers,
> Lars
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/virtualbrick/+bug/1246943/+subscriptions
>

Revision history for this message
Lars Kruse (devel-sumpfralle) wrote :

Hi Francesco,

all the changes included in that patch above are now committed to the branch.
Thus there is no need to review this patch.
I am closing this bug report.

cheers,
Lars

Changed in virtualbrick:
status: New → Fix Committed
Changed in virtualbrick:
milestone: none → 1.0
Changed in virtualbrick:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.