Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Portage warning message when running as a user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Tue May 21, 2019 7:59 pm    Post subject: [SOLVED] Portage warning message when running as a user Reply with quote

Portage shows the following error messages when running as from an unprivileged user (fturco):
Code:
$ emerge -p gcc
!!! Directory initialization failed: '/var/lib/portage'
!!! chown('/var/lib/portage', -1, 1000)
!!! Directory initialization failed: '/var/cache/edb'
!!! chown('/var/cache/edb', -1, 1000)

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/gcc-9.1.0

Some other info from my system:
Code:
$ id fturco
uid=1000(fturco) gid=1000(fturco) groups=1000(fturco),18(audio),19(cdrom),249(input),7(lp),106(lpadmin),105(plugdev),250(portage),101(scanner),85(usb),100(users),27(video),10(wheel)

Code:
$ id portage
uid=250(portage) gid=250(portage) groups=250(portage)

The emerge --info -v command returns the following variables:
Code:
PORTAGE_GID="1000"
PORTAGE_INST_GID="1000"
PORTAGE_INST_UID="1000"
PORTAGE_USERNAME="fturco"

I haven't explicitely set any of the previous portage variables in any file under the /etc/portage directory. I found this Funtoo bug report with a similar problem, but I can't understand how to apply their solution to my situation. Can anyone help me please?


Last edited by fturco on Sun May 26, 2019 9:13 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21920

PostPosted: Wed May 22, 2019 2:00 am    Post subject: Reply with quote

What was their solution? The linked bug report shows only an initial comment, with no responses before it was closed as "Expected Behavior."
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20113

PostPosted: Wed May 22, 2019 2:45 am    Post subject: Reply with quote

@Hu: Maybe a rendering issue? I see what fturco alluded to at the bug report.


@fturco: I'm skeptical of the "solution" and even more so about it being relevant to your situation.

The PORTAGE_USERNAME and PORTAGE*ID variables are set in make.conf (per the make.conf man page). Have you double-checked to make sure nothing is set? Also check in /etc/portage/profiles, local repos or other overlays. I'm not sure if those variables could be set there, but seems easy enough to check.

Also, what version of portage? I have sys-apps/portage-2.3.62-r2 and do not see this behavior.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Wed May 22, 2019 3:09 am    Post subject: Reply with quote

I've been running portage as root for many years. I never recall being to emerge as a user. Perhaps the user should be in the portage group?

Also try
Code:
chown -R portage:portage /usr/portage
as root to wipe out any possible root ownership.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21920

PostPosted: Wed May 22, 2019 4:12 am    Post subject: Reply with quote

pjp wrote:
@Hu: Maybe a rendering issue? I see what fturco alluded to at the bug report.
Probably. That tracker is a JIRA instance, and JIRA has had problems for years with malfunctioning under NoScript. They don't seem interested in fixing it. If I remember correctly, the problem is that the initially returned document is missing the responsive comments. Those all get added later with separate calls back to the server, which both lengthens page load time and causes an annoying jumpy effect as the browser repeatedly reflows the page to handle the late-added content. Browsers have gotten quite good at avoiding reflows for the main document, so eliminating all the extra callbacks would be an improvement in every respect: no more junk reflows; page load time improves; bandwidth consumed decreases by avoiding all the extra requests and round trips; page works under NoScript; page is directly useful to spider tools. Of course, most developers that create pages like that seem to think it's a feature that their page is broken when JavaScript is not executed.
Tony0945 wrote:
Perhaps the user should be in the portage group?
He already is in that group.
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Wed May 22, 2019 8:07 am    Post subject: Reply with quote

pjp wrote:
The PORTAGE_USERNAME and PORTAGE*ID variables are set in make.conf (per the make.conf man page). Have you double-checked to make sure nothing is set? Also check in /etc/portage/profiles, local repos or other overlays. I'm not sure if those variables could be set there, but seems easy enough to check.

The following commands display nothing:
Code:
grep PORTAGE_USERNAME -r /var/db/repos /etc/portage
grep PORTAGE_GID -r /var/db/repos /etc/portage
grep PORTAGE_INST_GID -r /var/db/repos /etc/portage
grep PORTAGE_INST_UID -r /var/db/repos /etc/portage

pjp wrote:
Also, what version of portage? I have sys-apps/portage-2.3.62-r2 and do not see this behavior.

I have sys-apps/portage-2.3.66-r1.
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Wed May 22, 2019 8:14 am    Post subject: Reply with quote

Tony0945 wrote:
Also try
Code:
chown -R portage:portage /usr/portage
as root to wipe out any possible root ownership.

Unfortunately the following command doesn't fix the problem:
Code:
chown -R portage:portage /var/cache/distfiles /var/cache/binpkgs /var/db/repos
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Sat May 25, 2019 8:10 pm    Post subject: Reply with quote

I filed a bug report: https://bugs.gentoo.org/686756
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1181
Location: Italy

PostPosted: Sun May 26, 2019 9:12 am    Post subject: Reply with quote

I solved my problem. It was due to the fact that the root directory (/) belonged to the fturco:fturco user and group instead of root:root.
Back to top
View user's profile Send private message
XenHat
n00b
n00b


Joined: 30 Sep 2019
Posts: 8
Location: Canada

PostPosted: Sat Dec 07, 2019 12:52 am    Post subject: Reply with quote

I was also able to get rid of the warning by changing the ownership of / to root:
Code:
# chown root:root /

Warning: do NOT include -R
_________________
You cannot fix what you haven't broken. I break things a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum