Opened 6 years ago

Closed 6 years ago

#56655 closed defect (duplicate)

permission errors

Reported by: tehcog (tehcog) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.5.2
Keywords: mavericks Cc: ballapete (Peter "Pete" Dyballa)
Port:

Description (last modified by tehcog (tehcog))

since upgrade to 2.5.2, I seem to be getting what seems to be permission related errors like:

Jun 12 17:17:13 xxx --->  Attempting to fetch dbus-1.12.8_2.darwin_13.x86_64.tbz2.rmd160 from https://packages.macports.org/dbus
Jun 12 17:17:13 xxx --->  Installing dbus @1.12.8_2
Jun 12 17:17:14 xxx --->  Cleaning dbus
Jun 12 17:17:14 xxx Error: Couldn't activate dbus 1.12.8_2: can't create directory "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_dbus": permission denied

and

Jun 12 17:17:15 xxx --->  Fetching archive for py27-lxml
Jun 12 17:17:15 xxx Error: Failed to archivefetch py27-lxml: could not set effective uid to 502: 1 Operation not permitted
Jun 12 17:17:15 xxx Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-lxml/py27-lxml/main.log for details.

any idea why? Using sudo to update / upgrade.

Change History (18)

comment:1 Changed 6 years ago by tehcog (tehcog)

Description: modified (diff)

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Component: portsbase
Keywords: permission removed
Port: random? removed
Summary: permission errors (mavericks)permission errors

Please attach any main.log files from such errors; maybe that will help identify the problem.

comment:3 Changed 6 years ago by jmroot (Joshua Root)

could not set effective uid to 502: 1 Operation not permitted

Seems like this would be the problem. Can't tell why it would be happening from the information provided though.

comment:4 Changed 6 years ago by tehcog (tehcog)

I have attached the main.log for py27-lxml

It is the only one available. Please let me know if you have any other questions.

Thanks

version:1
:debug:sysinfo OS X 10.9 (darwin/13.4.0) arch i386
:debug:sysinfo MacPorts 2.5.2
:debug:sysinfo Xcode 6.2
:debug:sysinfo SDK 10.9
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.9
:debug:main Executing org.macports.main (py27-lxml)
:debug:main dropping privileges: euid changed to 502, egid changed to 501.
:debug:fetch fetch phase started at Tue Jun 12 17:17:02 EDT 2018
:notice:fetch --->  Fetching distfiles for py27-lxml
:debug:fetch elevating privileges for fetch: euid changed to 0, egid changed to 0.
:debug:fetch dropping privileges: euid changed to 502, egid changed to 501.
:debug:fetch Executing org.macports.fetch (py27-lxml)
:info:fetch --->  lxml-4.2.1.tar.gz does not exist in /opt/local/var/macports/distfiles/py-lxml
:notice:fetch --->  Attempting to fetch lxml-4.2.1.tar.gz from https://distfiles.macports.org/py-lxml
version:1
:debug:sysinfo OS X 10.9 (darwin/13.4.0) arch i386
:debug:sysinfo MacPorts 2.5.2
:debug:sysinfo Xcode 6.2
:debug:sysinfo SDK 10.9
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.9
:msg:clean --->  Computing dependencies for py27-lxml:info:clean .:debug:clean py27-lxml has no conflicts
:debug:clean Searching for dependency: python27
:debug:clean Found Dependency: receipt exists for python27
:debug:clean Searching for dependency: zlib
:debug:clean Found Dependency: receipt exists for zlib
:debug:clean Searching for dependency: libxml2
:debug:clean Found Dependency: receipt exists for libxml2
:debug:clean Searching for dependency: libxslt
:debug:clean Found Dependency: receipt exists for libxslt
:debug:main Executing org.macports.main (py27-lxml)
:debug:main dropping privileges: euid changed to 502, egid changed to 501.
:debug:archivefetch archivefetch phase started at Tue Jun 12 17:17:15 EDT 2018
:msg:archivefetch --->  Fetching archive for py27-lxml
:debug:archivefetch Executing org.macports.archivefetch (py27-lxml)
:error:archivefetch Failed to archivefetch py27-lxml: could not set effective uid to 502: 1 Operation not permitted
:debug:archivefetch Error code: NONE
:debug:archivefetch Backtrace: could not set effective uid to 502: 1 Operation not permitted
:debug:archivefetch     while executing
:debug:archivefetch "seteuid $euid"
:debug:archivefetch     (procedure "chownAsRoot" line 7)
:debug:archivefetch     invoked from within
:debug:archivefetch "chownAsRoot $incoming_path"
:debug:archivefetch     (procedure "portarchivefetch::fetchfiles" line 16)
:debug:archivefetch     invoked from within
:debug:archivefetch "portarchivefetch::fetchfiles"
:debug:archivefetch     (procedure "portarchivefetch::archivefetch_main" line 5)
:debug:archivefetch     invoked from within
:debug:archivefetch "$procedure $targetname"
:error:archivefetch See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-lxml/py27-lxml/main.log for details.

comment:5 Changed 6 years ago by tehcog (tehcog)

BTW, during the upgrade, it threw the directory error (dbus) first.

Also, I was able to upgrade py27-lxml by itself. Then I was able to activate the newer version of dbus. Not sure what is going on with the exception of the ongoing issues with rust (#56322) and transcode (#56417), which ports keeps trying to rebuild.

comment:6 in reply to:  3 ; Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jmroot:

could not set effective uid to 502: 1 Operation not permitted

Seems like this would be the problem. Can't tell why it would be happening from the information provided though.

Does your macports user seem to be set up correctly? What's the output of dscl . -read /Users/macports?

comment:7 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

I have something similar on PPC Tiger, Mac OS X 10.4.11:

DEBUG: Archive dbus-1.12.8_2.darwin_8.ppc.tbz2 packaged
DEBUG: removing file: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus/dbus/work/destroot/+COMMENT
DEBUG: removing file: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus/dbus/work/destroot/+CONTENTS
DEBUG: removing file: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus/dbus/work/destroot/+DESC
DEBUG: removing file: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus/dbus/work/destroot/+PORTFILE
DEBUG: removing file: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus/dbus/work/destroot/+STATE
DEBUG: Executing org.macports.main (dbus)
DEBUG: clean phase started at Thu Jun 14 18:18:30 CEST 2018
--->  Cleaning dbus
DEBUG: Executing org.macports.clean (dbus)
--->  Removing work directory for dbus
DEBUG: Removing directory: /opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus/dbus
DEBUG: Removing symlink: /opt/local/var/macports/sources/lil.fr.rsync.macports.org/release/tarballs/ports/devel/dbus/work
DEBUG: Removing directory: /opt/local/var/macports/logs/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus/dbus
DEBUG: system: /bin/launchctl list org.freedesktop.dbus-system
com.bombich.ccc
com.DistortedVista.iStatMenusProcessServer
org.macports.privileged_startx
com.apple.KernelEventAgent
com.apple.dashboard.advisory.fetch
com.apple.dnbobserverd
com.apple.mDNSResponder
com.apple.nibindd
com.apple.periodic-daily
com.apple.periodic-monthly
com.apple.periodic-weekly
com.apple.portmap
com.apple.syslogd
com.vix.cron
org.postfix.master
org.xinetd.xinetd
com.openssh.sshd
DEBUG: dropping privileges: euid changed to 506, egid changed to 502.
DEBUG: elevating privileges for exec_as_uid: euid changed to 0, egid changed to 0.
DEBUG: dropping privileges: euid changed to 501, egid changed to 501.
DEBUG: system: /bin/launchctl list org.freedesktop.dbus-session
name.razzfazz.daemon.iScroll2
DEBUG: elevating privileges for exec_as_uid: euid changed to 0, egid changed to 0.
DEBUG: dropping privileges: euid changed to 506, egid changed to 502.
DEBUG: can't create directory "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_dbus": permission denied
    while executing
"file mkdir $workpath/.home"
    (procedure "open_statefile" line 7)
    invoked from within

Here obviously launchctl is used incorrectly. On Tiger launchctl does nor use an argument for the list (sub)command.

comment:8 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Cc: ballapete added

comment:9 Changed 6 years ago by kencu (Ken)

Same error here as the OP, trying to upgrade to dbus 1.12.8_2 on Tiger i386 with MacPorts 2.5.2

$ dscl . -read /Users/macports
_writers_passwd: macports
_writers_picture: macports
_writers_tim_password: macports
naprivs: 0
AppleMetaNodeLocation: /NetInfo/DefaultLocalNode
GeneratedUID: 6FBCBB62-1220-4820-80DC-FD881074B00C
NFSHomeDirectory: /opt/bootstrap/var/macports/home
Password: *
PrimaryGroupID: 500
RealName: MacPorts
RecordName: macports
RecordType: dsRecTypeStandard:Users
UniqueID: 502
UserShell: /usr/bin/false

I noted the NFSHomeDirectory is set to my /opt/bootstrap MacPorts installation. Previously that didn't seem to be an issue...

Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:10 in reply to:  6 Changed 6 years ago by tehcog (tehcog)

Replying to ryandesign:

Does your macports user seem to be set up correctly? What's the output of dscl . -read /Users/macports?

xxx::xxx { ~ }-> dscl . -read /Users/macports
AppleMetaNodeLocation: /Local/Default
GeneratedUID: D8597098-0B90-4223-B8B3-7FDA5A2E4783
NFSHomeDirectory: /opt/local/var/macports/home
Password: *
PrimaryGroupID: 501
RealName: MacPorts
RecordName: macports
RecordType: dsRecTypeStandard:Users
UniqueID: 502
UserShell: /usr/bin/false

comment:11 Changed 6 years ago by tehcog (tehcog)

I previously had a similar issue with net-snmp @5.7.3_8+ssl (could not create the dir):
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_net_net-snmp/
so I created the directory, then upgraded the port by itself and it seemed to work. Now I am not sure if I needed to create the directory based on what happened with dbus (there are about 14 of those directories in the "/opt/local/var/macports/build/" path). I think they all represent broken ports?

Last edited 6 years ago by tehcog (tehcog) (previous) (diff)

comment:12 Changed 6 years ago by kencu (Ken)

This is on 10.6.8

--->  Cleaning dbus
--->  Removing work directory for dbus
launch_msg(): Socket is not connected
Command failed: /bin/launchctl list org.freedesktop.dbus-system
Exit code: 1
launch_msg(): Socket is not connected
Command failed: /bin/launchctl list org.freedesktop.dbus-session
Exit code: 1
Error: Couldn't activate dbus 1.12.8_2+universal: can't create directory "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_dbus": permission denied
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

but interestingly, there is no problem activating it manually right after the failed install:

$ sudo port activate dbus
The following versions of dbus are currently installed:
 1) dbus @1.12.2_0+universal
 2) dbus @1.12.8_0+universal (active)
 3) dbus @1.12.8_2+universal
Enter a number to select an option: 3
--->  Deactivating dbus @1.12.8_0+universal
--->  Cleaning dbus
--->  Activating dbus @1.12.8_2+universal

comment:13 Changed 6 years ago by tehcog (tehcog)

Here is another for mavericks:

Jun 16 09:25:54 xxx === Upgrade Outdated Ports (port -p upgrade --enforce-variants outdated)
Jun 16 09:25:59 xxx --->  Computing dependencies for avahi
Jun 16 09:25:59 xxx --->  Fetching archive for avahi
Jun 16 09:26:02 xxx --->  Attempting to fetch avahi-0.7_2+gtk+gtk3+x11.darwin_13.x86_64.tbz2 from https://packages.macports.org/avahi
Jun 16 09:26:04 xxx --->  Attempting to fetch avahi-0.7_2+gtk+gtk3+x11.darwin_13.x86_64.tbz2.rmd160 from https://packages.macports.org/avahi
Jun 16 09:26:05 xxx --->  Installing avahi @0.7_2+gtk+gtk3+x11
Jun 16 09:26:05 xxx --->  Cleaning avahi
Jun 16 09:26:05 xxx Error: Couldn't activate avahi 0.7_2+gtk+gtk3+x11: can't create directory "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_net_avahi": permission denied
Jun 16 09:26:08 xxx --->  Computing dependencies for gstreamer1-gst-plugins-good
Jun 16 09:26:08 xxx --->  Fetching archive for gstreamer1-gst-plugins-good
Jun 16 09:26:08 xxx Error: Failed to archivefetch gstreamer1-gst-plugins-good: could not set effective uid to 502: 1 Operation not permitted
Jun 16 09:26:08 xxx Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_gstreamer1-gst-plugins-good/gstreamer1-gst-plugins-good/main.log for details.

comment:14 in reply to:  9 Changed 6 years ago by tehcog (tehcog)

Replying to kencu:

Same error here as the OP, trying to upgrade to dbus 1.12.8_2 on Tiger i386 with MacPorts 2.5.2

...

I noted the NFSHomeDirectory is set to my /opt/bootstrap MacPorts installation. Previously that didn't seem to be an issue...

Are you upgrading with a script (i am)? I am just wondering if my antiquated script is using deprecated commands.

comment:15 Changed 6 years ago by tehcog (tehcog)

It appears that 'selfupdate' is not performing a 'sync'. Is it supposed to?

It turns out that I had an error in my update/upgrade script regarding the sync. I have no reason to believe that it is related to the permissions issue, but I will have to wait and see.

Last edited 6 years ago by tehcog (tehcog) (previous) (diff)

comment:16 in reply to:  15 ; Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to tehcog:

It appears that 'selfupdate' is not performing a 'sync'. Is it supposed to?

selfupdate does perform sync, unless you use the --no-sync (formerly --nosync) flag.

comment:17 in reply to:  16 Changed 6 years ago by tehcog (tehcog)

Replying to ryandesign:

selfupdate does perform sync, unless you use the --no-sync (formerly --nosync) flag.

Thanks for the help. I have updated this to sync, and I have not had any permission errors since. Unless there are objections, I will re-submit a new ticket if I see this issue again.

Thank You

comment:18 Changed 6 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed

Looks like the same thing as #56721.

Note: See TracTickets for help on using tickets.