StackStorm / st2-auth-ldap

LDAP backend for user authentication in StackStorm. Previously LDAP backend for EWC.
https://docs.stackstorm.com/authentication.html
Apache License 2.0
5 stars 12 forks source link

pip/sudo warning during install/upgrade #56

Closed LindsayHill closed 5 years ago

LindsayHill commented 5 years ago

Running sudo apt-get upgrade on an EWC system results in these error messages:

The directory '/home/extreme/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Preparing to unpack .../st2-rbac-backend_3.0dev-4_amd64.deb ...
Unpacking st2-rbac-backend (3.0dev-4) over (3.0dev-3) ...
The directory '/home/extreme/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/extreme/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

We should fix or suppress both the pip version warning, and the warning about sudo -H.

Same issue applies to github.com/StackStorm/st2-enterprise-rbac-backend packages too.

LindsayHill commented 5 years ago

NB Errors are harmless, this is mostly a cosmetic thing

Kami commented 5 years ago

Hm, I'm unable to replicate this on Ubuntu and RHEL.

It only happens if --quiet flag is not passed to pip, but we already pass it to pip in postinst - https://github.com/StackStorm/st2-enterprise-auth-backend-ldap/blob/master/debian/postinst#L23

EDIT: Nvm it happens on postun (uninstall) and not postinst (install).

LindsayHill commented 5 years ago

I saw this again today when upgrading to these packages on a U16 system using unstable repos:

extreme@ubuntu:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  st2-auth-ldap st2-rbac-backend ureadahead
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 584 kB of archives.
After this operation, 52.2 kB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 ureadahead amd64 0.100.0-19.1 [19.4 kB]
Get:2 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial/main amd64 st2-auth-ldap amd64 3.1dev-2 [454 kB]
Get:3 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial/main amd64 st2-rbac-backend amd64 3.1dev-3 [111 kB]
Fetched 584 kB in 1s (419 kB/s)
(Reading database ... 153914 files and directories currently installed.)
Preparing to unpack .../st2-auth-ldap_3.1dev-2_amd64.deb ...
Unpacking st2-auth-ldap (3.1dev-2) over (3.1dev-1) ...
The directory '/home/extreme/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/extreme/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 9.0.1, however version 19.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Preparing to unpack .../st2-rbac-backend_3.1dev-3_amd64.deb ...
Unpacking st2-rbac-backend (3.1dev-3) over (3.1dev-1) ...
The directory '/home/extreme/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/extreme/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 9.0.1, however version 19.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Preparing to unpack .../ureadahead_0.100.0-19.1_amd64.deb ...
Unpacking ureadahead (0.100.0-19.1) over (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up st2-auth-ldap (3.1dev-2) ...
Setting up st2-rbac-backend (3.1dev-3) ...
Setting up ureadahead (0.100.0-19.1) ...
extreme@ubuntu:~$

I think that this might be because it still uses the older versions of the package scripts on the first upgrade. But it might be OK for the next upgrade

Kami commented 5 years ago

Hm, would also be good to test a fresh installation.

Kami commented 5 years ago

I just quickly tried a fresh installation (Ubuntu 16.04) and I didn't see those messages

20190501T091736+0000 Hit:10 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial InRelease
20190501T091736+0000 Hit:11 https://packagecloud.io/StackStorm/staging-unstable/ubuntu xenial InRelease
20190501T091737+0000 Reading package lists...
20190501T091738+0000 Reading package lists...
20190501T091738+0000 Building dependency tree...
20190501T091738+0000 Reading state information...
20190501T091738+0000 The following additional packages will be installed:
20190501T091738+0000   bwc-ui st2-auth-ldap st2-rbac-backend st2flow
20190501T091738+0000 The following packages will be REMOVED:
20190501T091738+0000   st2web
20190501T091738+0000 The following NEW packages will be installed:
20190501T091738+0000   bwc-enterprise bwc-ui st2-auth-ldap st2-rbac-backend st2flow
20190501T091738+0000 0 upgraded, 5 newly installed, 1 to remove and 73 not upgraded.
20190501T091738+0000 Need to get 3,499 kB of archives.
20190501T091738+0000 After this operation, 7,598 kB of additional disk space will be used.
20190501T091738+0000 Get:1 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial/main amd64 bwc-ui amd64 3.1dev-1 [1,050 kB]
20190501T091739+0000 Get:2 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial/main amd64 st2-auth-ldap amd64 3.1dev-2 [454 kB]
20190501T091739+0000 Get:3 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial/main amd64 st2-rbac-backend amd64 3.1dev-3 [111 kB]
20190501T091739+0000 Get:4 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial/main amd64 st2flow amd64 3.1dev-1 [1,874 kB]
20190501T091740+0000 Get:5 https://packagecloud.io/StackStorm/staging-enterprise-unstable/ubuntu xenial/main amd64 bwc-enterprise all 3.1dev-1 [9,902 B]
20190501T091740+0000 Fetched 3,499 kB in 1s (1,761 kB/s)
(Reading database ... 111762 files and directories currently installed.)0000 (Reading database ... 
20190501T091740+0000 Removing st2web (3.1dev-1) ...
20190501T091740+0000 Selecting previously unselected package bwc-ui.
(Reading database ... 111716 files and directories currently installed.)
20190501T091740+0000 Preparing to unpack .../bwc-ui_3.1dev-1_amd64.deb ...
20190501T091740+0000 Unpacking bwc-ui (3.1dev-1) ...
20190501T091740+0000 Selecting previously unselected package st2-auth-ldap.
20190501T091740+0000 Preparing to unpack .../st2-auth-ldap_3.1dev-2_amd64.deb ...
20190501T091740+0000 Unpacking st2-auth-ldap (3.1dev-2) ...
20190501T091740+0000 Selecting previously unselected package st2-rbac-backend.
20190501T091740+0000 Preparing to unpack .../st2-rbac-backend_3.1dev-3_amd64.deb ...
20190501T091740+0000 Unpacking st2-rbac-backend (3.1dev-3) ...
20190501T091740+0000 Setting up bwc-ui (3.1dev-1) ...
20190501T091740+0000 Installing new version of config file /opt/stackstorm/static/webui/config.js ...
20190501T091741+0000 Selecting previously unselected package st2flow.
(Reading database ... 111791 files and directories currently installed.)
20190501T091741+0000 Preparing to unpack .../st2flow_3.1dev-1_amd64.deb ...
20190501T091741+0000 Unpacking st2flow (3.1dev-1) ...
20190501T091741+0000 Selecting previously unselected package bwc-enterprise.
20190501T091741+0000 Preparing to unpack .../bwc-enterprise_3.1dev-1_all.deb ...
20190501T091741+0000 Unpacking bwc-enterprise (3.1dev-1) ...
20190501T091741+0000 Setting up st2-auth-ldap (3.1dev-2) ...
20190501T091742+0000 Setting up st2-rbac-backend (3.1dev-3) ...
20190501T091743+0000 Setting up st2flow (3.1dev-1) ...
20190501T091743+0000 Setting up bwc-enterprise (3.1dev-1) ...
20190501T091744+0000 Reading package lists...
20190501T091745+0000 Building dependency tree...
20190501T091745+0000 Reading state information...
20190501T091745+0000 crudini is already the newest version (0.7-1).
20190501T091745+0000 0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.
20190501T091746+0000 2019-05-01 09:17:46,017 INFO [-] Connecting to database "st2" @ "127.0.0.1:27017" as user "stackstorm".
20190501T091746+0000 2019-05-01 09:17:46,021 INFO [-] Successfully connected to database "st2" @ "127.0.0.1:27017" as user "stackstorm".
20190501T091746+0000 2019-05-01 09:17:46,233 INFO [-] Loading role definitions from "/opt/stackstorm/rbac/roles/"

In any case, we should still keep an eye on it.