postinst fails when names have unusual characters

Bug #1195096 reported by Andrew Mahurin on 2013-06-27
198
This bug affects 56 people
Affects Status Importance Assigned to Milestone
samba4 (Ubuntu)
Critical
smita

Bug Description

This error message occurs in the output from whenever I run the "apt-get" command, ever since installing samba4.

Setting up samba4 (4.0.0+dfsg1-1ubuntu1) ...
ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to parse dn string
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/dbcheck.py", line 108, in run
    fix=fix, yes=yes, quiet=quiet, in_transaction=started_transaction)
  File "/usr/lib/python2.7/dist-packages/samba/dbchecker.py", line 56, in __init__
    self.infrastructure_dn = ldb.Dn(samdb, "CN=Infrastructure," + samdb.domain_dn())
dpkg: error processing samba4 (--configure):
 subprocess installed post-installation script returned error exit status 255

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

affects: update-manager (Ubuntu) → samba4 (Ubuntu)
information type: Private Security → Public

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in samba4 (Ubuntu):
status: New → Confirmed
Timo Aaltonen (tjaalton) on 2013-07-09
Changed in samba4 (Ubuntu):
importance: Undecided → Critical
Vincent Gerris (vgerris) wrote :

I have the same issue.
During install it complained about a netbios name.
That is probably the cause.
I get:
Setting up samba4 (4.0.1+dfsg1-1) ...
ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to parse dn string

Did you find any solution???

2013/8/16 Vincent Gerris <email address hidden>

> I have the same issue.
> During install it complained about a netbios name.
> That is probably the cause.
> I get:
> Setting up samba4 (4.0.1+dfsg1-1) ...
> ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to
> parse dn string
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1178930).
> https://bugs.launchpad.net/bugs/1195096
>
> Title:
> Problem with post-installation script
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
>

Scott Spanbauer (t-scott) wrote :

No, sorry. The problem only comes up during installation, so it's not a big
bother.

On Fri, Aug 16, 2013 at 6:49 AM, axelsvag <email address hidden>wrote:

> Did you find any solution???
>
>
> 2013/8/16 Vincent Gerris <email address hidden>
>
> > I have the same issue.
> > During install it complained about a netbios name.
> > That is probably the cause.
> > I get:
> > Setting up samba4 (4.0.1+dfsg1-1) ...
> > ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to
> > parse dn string
> >
> > --
> > You received this bug notification because you are subscribed to a
> > duplicate bug report (1178930).
> > https://bugs.launchpad.net/bugs/1195096
> >
> > Title:
> > Problem with post-installation script
> >
> > To manage notifications about this bug go to:
> >
> >
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
> >
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1190684).
> https://bugs.launchpad.net/bugs/1195096
>
> Title:
> Problem with post-installation script
>
> Status in “samba4” package in Ubuntu:
> Confirmed
>
> Bug description:
> This error message occurs in the output from whenever I run the "apt-
> get" command, ever since installing samba4.
>
> Setting up samba4 (4.0.0+dfsg1-1ubuntu1) ...
> ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to
> parse dn string
> File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line
> 175, in _run
> return self.run(*args, **kwargs)
> File "/usr/lib/python2.7/dist-packages/samba/netcmd/dbcheck.py", line
> 108, in run
> fix=fix, yes=yes, quiet=quiet, in_transaction=started_transaction)
> File "/usr/lib/python2.7/dist-packages/samba/dbchecker.py", line 56,
> in __init__
> self.infrastructure_dn = ldb.Dn(samdb, "CN=Infrastructure," +
> samdb.domain_dn())
> dpkg: error processing samba4 (--configure):
> subprocess installed post-installation script returned error exit
> status 255
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
>
>

axelsvag (darinsson) wrote :

For me it is strange, and I have no clue what to change. in my etc/fstab I
got the ipnumber followed by Volume_1 which I created earlier like this
192.168.1.145/Volume_1. But no luck to ge any allowance...But I f use
nautilus to just go into the share it is no problem at all. This was so
easy in the normal firmware..... what have changed????

2013/8/19 Scott Spanbauer <email address hidden>

> No, sorry. The problem only comes up during installation, so it's not a big
> bother.
>
>
> On Fri, Aug 16, 2013 at 6:49 AM, axelsvag <<email address hidden>
> >wrote:
>
> > Did you find any solution???
> >
> >
> > 2013/8/16 Vincent Gerris <email address hidden>
> >
> > > I have the same issue.
> > > During install it complained about a netbios name.
> > > That is probably the cause.
> > > I get:
> > > Setting up samba4 (4.0.1+dfsg1-1) ...
> > > ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to
> > > parse dn string
> > >
> > > --
> > > You received this bug notification because you are subscribed to a
> > > duplicate bug report (1178930).
> > > https://bugs.launchpad.net/bugs/1195096
> > >
> > > Title:
> > > Problem with post-installation script
> > >
> > > To manage notifications about this bug go to:
> > >
> > >
> >
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
> > >
> >
> > --
> > You received this bug notification because you are subscribed to a
> > duplicate bug report (1190684).
> > https://bugs.launchpad.net/bugs/1195096
> >
> > Title:
> > Problem with post-installation script
> >
> > Status in “samba4” package in Ubuntu:
> > Confirmed
> >
> > Bug description:
> > This error message occurs in the output from whenever I run the "apt-
> > get" command, ever since installing samba4.
> >
> > Setting up samba4 (4.0.0+dfsg1-1ubuntu1) ...
> > ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to
> > parse dn string
> > File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py",
> line
> > 175, in _run
> > return self.run(*args, **kwargs)
> > File "/usr/lib/python2.7/dist-packages/samba/netcmd/dbcheck.py", line
> > 108, in run
> > fix=fix, yes=yes, quiet=quiet, in_transaction=started_transaction)
> > File "/usr/lib/python2.7/dist-packages/samba/dbchecker.py", line 56,
> > in __init__
> > self.infrastructure_dn = ldb.Dn(samdb, "CN=Infrastructure," +
> > samdb.domain_dn())
> > dpkg: error processing samba4 (--configure):
> > subprocess installed post-installation script returned error exit
> > status 255
> >
> > To manage notifications about this bug go to:
> >
> >
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
> >
> >
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1178930).
> https://bugs.launchpad.net/bugs/1195096
>
> Title:
> Problem with post-installation script
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
>

Scott Spanbauer (t-scott) wrote :
Download full text (4.6 KiB)

I really don't know...I'm just an occasional Ubunto user, sorry.

On Mon, Aug 19, 2013 at 10:45 AM, axelsvag <email address hidden>wrote:

> For me it is strange, and I have no clue what to change. in my etc/fstab I
> got the ipnumber followed by Volume_1 which I created earlier like this
> 192.168.1.145/Volume_1. But no luck to ge any allowance...But I f use
> nautilus to just go into the share it is no problem at all. This was so
> easy in the normal firmware..... what have changed????
>
>
> 2013/8/19 Scott Spanbauer <email address hidden>
>
> > No, sorry. The problem only comes up during installation, so it's not a
> big
> > bother.
> >
> >
> > On Fri, Aug 16, 2013 at 6:49 AM, axelsvag <<email address hidden>
> > >wrote:
> >
> > > Did you find any solution???
> > >
> > >
> > > 2013/8/16 Vincent Gerris <email address hidden>
> > >
> > > > I have the same issue.
> > > > During install it complained about a netbios name.
> > > > That is probably the cause.
> > > > I get:
> > > > Setting up samba4 (4.0.1+dfsg1-1) ...
> > > > ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to
> > > > parse dn string
> > > >
> > > > --
> > > > You received this bug notification because you are subscribed to a
> > > > duplicate bug report (1178930).
> > > > https://bugs.launchpad.net/bugs/1195096
> > > >
> > > > Title:
> > > > Problem with post-installation script
> > > >
> > > > To manage notifications about this bug go to:
> > > >
> > > >
> > >
> >
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
> > > >
> > >
> > > --
> > > You received this bug notification because you are subscribed to a
> > > duplicate bug report (1190684).
> > > https://bugs.launchpad.net/bugs/1195096
> > >
> > > Title:
> > > Problem with post-installation script
> > >
> > > Status in “samba4” package in Ubuntu:
> > > Confirmed
> > >
> > > Bug description:
> > > This error message occurs in the output from whenever I run the "apt-
> > > get" command, ever since installing samba4.
> > >
> > > Setting up samba4 (4.0.0+dfsg1-1ubuntu1) ...
> > > ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable to
> > > parse dn string
> > > File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py",
> > line
> > > 175, in _run
> > > return self.run(*args, **kwargs)
> > > File "/usr/lib/python2.7/dist-packages/samba/netcmd/dbcheck.py",
> line
> > > 108, in run
> > > fix=fix, yes=yes, quiet=quiet,
> in_transaction=started_transaction)
> > > File "/usr/lib/python2.7/dist-packages/samba/dbchecker.py", line
> 56,
> > > in __init__
> > > self.infrastructure_dn = ldb.Dn(samdb, "CN=Infrastructure," +
> > > samdb.domain_dn())
> > > dpkg: error processing samba4 (--configure):
> > > subprocess installed post-installation script returned error exit
> > > status 255
> > >
> > > To manage notifications about this bug go to:
> > >
> > >
> >
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
> > >
> > >
> >
> > --
> > You received this bug notification because you are subscribed to a
> > duplicate bug report (1178930).
> > https://bugs.launchpad.net/bugs/119...

Read more...

axelsvag (darinsson) wrote :
Download full text (5.3 KiB)

Ok But I think it is general in all Linux systems??

2013/8/19 Scott Spanbauer <email address hidden>

> I really don't know...I'm just an occasional Ubunto user, sorry.
>
>
> On Mon, Aug 19, 2013 at 10:45 AM, axelsvag <<email address hidden>
> >wrote:
>
> > For me it is strange, and I have no clue what to change. in my etc/fstab
> I
> > got the ipnumber followed by Volume_1 which I created earlier like this
> > 192.168.1.145/Volume_1. But no luck to ge any allowance...But I f use
> > nautilus to just go into the share it is no problem at all. This was so
> > easy in the normal firmware..... what have changed????
> >
> >
> > 2013/8/19 Scott Spanbauer <email address hidden>
> >
> > > No, sorry. The problem only comes up during installation, so it's not a
> > big
> > > bother.
> > >
> > >
> > > On Fri, Aug 16, 2013 at 6:49 AM, axelsvag <<email address hidden>
> > > >wrote:
> > >
> > > > Did you find any solution???
> > > >
> > > >
> > > > 2013/8/16 Vincent Gerris <email address hidden>
> > > >
> > > > > I have the same issue.
> > > > > During install it complained about a netbios name.
> > > > > That is probably the cause.
> > > > > I get:
> > > > > Setting up samba4 (4.0.1+dfsg1-1) ...
> > > > > ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable
> to
> > > > > parse dn string
> > > > >
> > > > > --
> > > > > You received this bug notification because you are subscribed to a
> > > > > duplicate bug report (1178930).
> > > > > https://bugs.launchpad.net/bugs/1195096
> > > > >
> > > > > Title:
> > > > > Problem with post-installation script
> > > > >
> > > > > To manage notifications about this bug go to:
> > > > >
> > > > >
> > > >
> > >
> >
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
> > > > >
> > > >
> > > > --
> > > > You received this bug notification because you are subscribed to a
> > > > duplicate bug report (1190684).
> > > > https://bugs.launchpad.net/bugs/1195096
> > > >
> > > > Title:
> > > > Problem with post-installation script
> > > >
> > > > Status in “samba4” package in Ubuntu:
> > > > Confirmed
> > > >
> > > > Bug description:
> > > > This error message occurs in the output from whenever I run the
> "apt-
> > > > get" command, ever since installing samba4.
> > > >
> > > > Setting up samba4 (4.0.0+dfsg1-1ubuntu1) ...
> > > > ERROR(<type 'exceptions.ValueError'>): uncaught exception - unable
> to
> > > > parse dn string
> > > > File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py",
> > > line
> > > > 175, in _run
> > > > return self.run(*args, **kwargs)
> > > > File "/usr/lib/python2.7/dist-packages/samba/netcmd/dbcheck.py",
> > line
> > > > 108, in run
> > > > fix=fix, yes=yes, quiet=quiet,
> > in_transaction=started_transaction)
> > > > File "/usr/lib/python2.7/dist-packages/samba/dbchecker.py", line
> > 56,
> > > > in __init__
> > > > self.infrastructure_dn = ldb.Dn(samdb, "CN=Infrastructure," +
> > > > samdb.domain_dn())
> > > > dpkg: error processing samba4 (--configure):
> > > > subprocess installed post-installation script returned error exit
> > > > status 255
> > > >
> > > > To manage notificatio...

Read more...

Scott Spanbauer (t-scott) wrote :
Download full text (7.1 KiB)

I don't know, sorry. Not an expert, just clicked yes on an error reporting
tool.

On Mon, Aug 19, 2013 at 12:27 PM, axelsvag <email address hidden>wrote:

> Ok But I think it is general in all Linux systems??
>
>
> 2013/8/19 Scott Spanbauer <email address hidden>
>
> > I really don't know...I'm just an occasional Ubunto user, sorry.
> >
> >
> > On Mon, Aug 19, 2013 at 10:45 AM, axelsvag <<email address hidden>
> > >wrote:
> >
> > > For me it is strange, and I have no clue what to change. in my
> etc/fstab
> > I
> > > got the ipnumber followed by Volume_1 which I created earlier like
> this
> > > 192.168.1.145/Volume_1. But no luck to ge any allowance...But I f
> use
> > > nautilus to just go into the share it is no problem at all. This was
> so
> > > easy in the normal firmware..... what have changed????
> > >
> > >
> > > 2013/8/19 Scott Spanbauer <email address hidden>
> > >
> > > > No, sorry. The problem only comes up during installation, so it's
> not a
> > > big
> > > > bother.
> > > >
> > > >
> > > > On Fri, Aug 16, 2013 at 6:49 AM, axelsvag <
> <email address hidden>
> > > > >wrote:
> > > >
> > > > > Did you find any solution???
> > > > >
> > > > >
> > > > > 2013/8/16 Vincent Gerris <email address hidden>
> > > > >
> > > > > > I have the same issue.
> > > > > > During install it complained about a netbios name.
> > > > > > That is probably the cause.
> > > > > > I get:
> > > > > > Setting up samba4 (4.0.1+dfsg1-1) ...
> > > > > > ERROR(<type 'exceptions.ValueError'>): uncaught exception -
> unable
> > to
> > > > > > parse dn string
> > > > > >
> > > > > > --
> > > > > > You received this bug notification because you are subscribed to
> a
> > > > > > duplicate bug report (1178930).
> > > > > > https://bugs.launchpad.net/bugs/1195096
> > > > > >
> > > > > > Title:
> > > > > > Problem with post-installation script
> > > > > >
> > > > > > To manage notifications about this bug go to:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/1195096/+subscriptions
> > > > > >
> > > > >
> > > > > --
> > > > > You received this bug notification because you are subscribed to a
> > > > > duplicate bug report (1190684).
> > > > > https://bugs.launchpad.net/bugs/1195096
> > > > >
> > > > > Title:
> > > > > Problem with post-installation script
> > > > >
> > > > > Status in “samba4” package in Ubuntu:
> > > > > Confirmed
> > > > >
> > > > > Bug description:
> > > > > This error message occurs in the output from whenever I run the
> > "apt-
> > > > > get" command, ever since installing samba4.
> > > > >
> > > > > Setting up samba4 (4.0.0+dfsg1-1ubuntu1) ...
> > > > > ERROR(<type 'exceptions.ValueError'>): uncaught exception -
> unable
> > to
> > > > > parse dn string
> > > > > File
> "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py",
> > > > line
> > > > > 175, in _run
> > > > > return self.run(*args, **kwargs)
> > > > > File
> "/usr/lib/python2.7/dist-packages/samba/netcmd/dbcheck.py",
> > > line
> > > > > 108, in run
> > > > > fix=fix, yes=yes, quiet=quiet,
> > > in_transaction=started_transaction)
> > > > > File "/usr/lib/pytho...

Read more...

I think this would impact other flavors of Linux as well. After the error if you edit the /var/lib/dpkg/status file it shows that samba4 is "install ok halfconfigured"

I added some outf.writes and looked into the code and the samdb reference looks to be invalid when it is passed from the dbcheck.py into the dbchecker.py.

Given that you can run dbcheck in the samba-tools utilites I decided to just comment out these lines during install and fix the DN later when I am setting up my active directory. comment out the following lines:

lines 107,108
lines 116-117
add line 118 (it's python so be sure to line up with line above),
                 error_count = 0

The install worked, I haven't confirmed the config or setup the active directory yet, but it seems like a work around for the install portion.

Jeff Karau (jkarau) wrote :

I forgot to say which file was modified, it was dbcheck.py. the full path is in the error in the OP.

It sounds like bug 1235984
If you share's name has dashes, underscores, or other non alphanumeric characters, that is what's tripping the netbios name error.

smita (smitaprabhu95) on 2015-10-04
Changed in samba4 (Ubuntu):
assignee: nobody → smita (smitaprabhu95)
Robie Basak (racb) on 2015-10-06
summary: - Problem with post-installation script
+ postinst fails when names have unusual characters
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers