Opened 9 years ago

Closed 6 years ago

#28121 closed defect (fixed)

dbus @1.2.24 +no_root fails with dscl error when ${install.user} does not exist

Reported by: ph227@… Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: jtbates@…, frozencemetery (Robbie Harwood)
Port: dbus

Description

I was trying to install meld port, but failed on dbus dependency. The command :

port -d install dbus +no_root

fail with :

DEBUG: Changing to port directory: /Users/nicoph/macport/var/macports/sources/rsync.macports.org/release/ports/devel/dbus
DEBUG: OS darwin/10.4.2 (Mac OS X 10.6) arch i386
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.unload registered provides 'unload', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: Using group file /Users/nicoph/macport/var/macports/sources/rsync.macports.org/release/ports/_resources/port1.0/group/muniversal-1.0.tcl
DEBUG: Reading variant descriptions from /Users/nicoph/macport/var/macports/sources/rsync.macports.org/release/ports/_resources/port1.0/variant_descriptions.conf
DEBUG: universal variant already exists, so not adding the default one
DEBUG: Requested variant bash_completion is not provided by port dbus.
DEBUG: Executing variant no_root provides no_root
DEBUG: <dscl_cmd> DS Error: -14136 (eDSRecordNotFound)
    while executing
"exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory"
    (procedure "variant-no_root" line 15)
    invoked from within
"variant-no_root"
    invoked from within
"catch "variant-${name}" result"
Error: dbus: Error executing no_root: <dscl_cmd> DS Error: -14136 (eDSRecordNotFound)
DEBUG: Error evaluating variants
    while executing
"error "Error evaluating variants""
    (procedure "mportopen" line 58)
    invoked from within
"mportopen $porturl [array get options] [array get requested_variations]"
Error: Unable to open port: Error evaluating variants
To report a bug, see <http://guide.macports.org/#project.tickets>

My specs :

  • MacPort 1.9.2 (user local installation from sources)
  • Os X 10.6.4
  • XCode 3.2.4

Change History (12)

comment:1 Changed 9 years ago by ph227@…

An additionnal missing information : macport was compiled with :

./configure --prefix=/Users/nicoph/macport --with-install-user=nicoph --with-macports-user=nicoph --with-no-root-privileges --with-install-group=nogroup

comment:2 Changed 9 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to mcalhoun@…
Port: dbus added
Summary: dbus @1.2.24 +no_rootdbus @1.2.24 +no_root fails with dscl error

Please remember to fill in the Port field, cc the maintainer, and use a descriptive summary.

comment:3 Changed 9 years ago by ph227@…

Sorry, i missed the port field.

After some investigation, i found the origin of the issue : in the file var/macports/sources/rsync.macports.org/release/ports/devel/dbus/Portfile, line 197

the instruction

set startup_root  [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]

don't give the expected result, until my session is authenticated with kerberos and the user is not locally known by dscl.

comment:4 Changed 9 years ago by jmroot (Joshua Root)

Resolution: invalid
Status: newclosed
Summary: dbus @1.2.24 +no_root fails with dscl errordbus @1.2.24 +no_root fails with dscl error when ${install.user} does not exist

So yeah, your configured install user has to exist when you run port.

comment:5 in reply to:  4 Changed 9 years ago by ph227@…

Resolution: invalid
Status: closedreopened

Replying to jmr@…:

So yeah, your configured install user has to exist when you run port.

My bad, my description was not clear enough: dbus +no_root fails with dscl error when ${install.user} does not exist in "."

This is still true with dbus @1.4.16 (since this is not related to dbus but to dbus Portfile).

dscl can't find my username in the local datasource, since my user is registered to a domain. So this command :

dscl '/Active Directory/All Domains' -read Users/${install.user} NFSHomeDirectory

works well for me.

comment:6 Changed 8 years ago by jtbates@…

I have the same problem. ph277, how do I use your fix?

comment:7 Changed 8 years ago by jtbates@…

Cc: jtbates@… added

Cc Me!

comment:8 in reply to:  6 Changed 8 years ago by ph227@…

Replying to jtbates@…:

I have the same problem. ph277, how do I use your fix?

This is case-specific, but for me, in the file: [your macport installation path]/var/macports/sources/rsync.macports.org/release/ports/devel/dbus/Portfile

I change the line

set startup_root  [join [lrange [exec /usr/bin/dscl . -read Users/${install.user} NFSHomeDirectory] 1 end]]

to

set startup_root  [join [lrange [exec /usr/bin/dscl '/Active Directory/All Domains' -read Users/${install.user} NFSHomeDirectory] 1 end]]

and I run again the package installation.

comment:9 Changed 7 years ago by frozencemetery (Robbie Harwood)

It's slightly more bloody than that. When I have +no_root set in variants.conf, the following occurs:

$ port -v info dbus  
Error: dbus: Error executing no_root: <dscl_cmd> DS Error: -14136 (eDSRecordNotFound)  
Error: Unable to open port: Error evaluating variants  

Setting install.user blank explicitly immediately before it is checked (line 202 of Portfile) causes the problem to disappear, while setting it to my actual username causes the same error. Needless to say, this throws errors later on the relevant chown/chgrp commands, but it does cause the port to install.

comment:10 Changed 7 years ago by frozencemetery (Robbie Harwood)

Cc: rharwood@… added

Cc Me!

comment:11 Changed 7 years ago by frozencemetery (Robbie Harwood)

This problem is still present in version 1.6.12.

comment:12 Changed 6 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: reopenedclosed

Hopefully, this is fixed in r118513.

dubs now tries to find the home directory using more than one way.

Please feel free to reopen if the problem still exists.

Note: See TracTickets for help on using tickets.