Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu packages fail to install/remove/purge - deadlock #3926

Closed
Marwe opened this issue Sep 23, 2018 · 8 comments
Closed

Ubuntu packages fail to install/remove/purge - deadlock #3926

Marwe opened this issue Sep 23, 2018 · 8 comments
Labels
major A high priority issue which might affect a lot of people or large parts of the codebase

Comments

@Marwe
Copy link

Marwe commented Sep 23, 2018

The ubuntu packages in the ppa repo have some problems (xenial, 16.04 here).
I wanted to install geonode with

sudo add-apt-repository ppa:geonode/stable
sudo apt-get update; sudo apt-get upgrade; sudo apt-get autoremove
sudo apt-get install geonode

but got the following errors:

# apt install geonode
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python-backports.functools-lru-cache python-django python-django-allauth
[SNIP]
The following NEW packages will be installed:
  geonode python-backports.functools-lru-cache python-django python-django-allauth
  python-django-bootstrap-form python-django-cuser python-django-downloadview
  python-django-filters python-django-guardian python-django-haystack
  python-django-import-export python-django-leaflet python-django-model-utils
  python-django-multi-email-field python-django-oauth-toolkit
  python-django-rest-swagger python-django-reversion python-django-treebeard
  python-djangorestframework python-djangorestframework-gis python-drf-nested-routers
  python-drf-openapi python-geonode-notification python-pep8
  python-pinax-notifications python-pinax-theme-bootstrap
0 upgraded, 26 newly installed, 0 to remove and 117 not upgraded.
Need to get 0 B/11.3 MB of archives.
After this operation, 39.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
(Reading database ... 840588 files and directories currently installed.)
Preparing to unpack .../python-backports.functools-lru-cache_0.0.0-1_all.deb ...
Unpacking python-backports.functools-lru-cache (0.0.0-1) ...
dpkg: error processing archive /var/cache/apt/archives/python-backports.functools-lru-cache_0.0.0-1_all.deb (--unpack):
 trying to overwrite '/usr/lib/python2.7/dist-packages/backports/__init__.py', which is also in package python-backports.ssl-match-hostname 3.4.0.2-1
Preparing to unpack .../python-django_1.8.19-1_all.deb ...
Unpacking python-django (1.8.19-1) ...
dpkg: error processing archive /var/cache/apt/archives/python-django_1.8.19-1_all.deb (--unpack):
 trying to overwrite '/usr/bin/django-admin', which is also in package python-django-common 1.8.7-1ubuntu5.6
[SNIP]
Preparing to unpack .../python-pep8_1.7.1-1_all.deb ...
Unpacking python-pep8 (1.7.1-1) ...
dpkg: error processing archive /var/cache/apt/archives/python-pep8_1.7.1-1_all.deb (--unpack):
 trying to overwrite '/usr/bin/pep8', which is also in package pep8 1.7.0-2
[SNIP]
Preparing to unpack .../geonode_2.8.0+thefinal1_all.deb ...
Unpacking geonode (2.8.0+thefinal1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python-backports.functools-lru-cache_0.0.0-1_all.deb
 /var/cache/apt/archives/python-django_1.8.19-1_all.deb
 /var/cache/apt/archives/python-pep8_1.7.1-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

These are three issues with the respective packages in the ppa.
Then I unsuccessfully tried to remove or purge geonode to get back to a clean state with:

# apt remove geonode
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 python-django-allauth : Depends: python-django but it is not going to be installed
[SNIP]
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Hm, pretty stuck situation at this point, since -f install does not provide a working solution. I did not find a quick solution on the commandline, and used synaptic to resolve by removing all broken packages and their dependencies (filter - broken pacakges - select all - remove):

geonode will be removed
python-django-allauth will be removed
python-django-bootstrap-form will be removed
python-django-cuser will be removed
python-django-downloadview will be removed
python-django-filters will be removed
python-django-guardian will be removed
python-django-haystack will be removed
python-django-import-export will be removed
python-django-leaflet will be removed
python-django-model-utils will be removed
python-django-multi-email-field will be removed
python-django-oauth-toolkit will be removed
python-django-rest-swagger will be removed
python-django-reversion will be removed
python-django-treebeard will be removed
python-djangorestframework will be removed
python-djangorestframework-gis will be removed
python-drf-nested-routers will be removed
python-drf-openapi will be removed
python-geonode-notification will be removed
python-pinax-notifications will be removed
python-pinax-theme-bootstrap will be removed

which fails on package geonode:

Removing geonode (2.8.0+thefinal1) ...
ERROR: Site geonode does not exist!
dpkg: error processing package geonode (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing python-django-allauth (0.34.0-1) ...
[SNIP]
Errors were encountered while processing:
 geonode
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:

deadlock

At this point I had to look into the postrm script and patch it to remove/purge geonode by commenting out this line out with a #:

/var/lib/dpkg/info/geonode.postrm:    a2dissite geonode.conf

10c10
<     a2dissite geonode.conf
---
>     #a2dissite geonode.conf

This apache command fails, since there is no such thing/site configured, and the postrm script bails out with an error.

Now I don't know what exactly needs fixing, but guess

  • at least the postrm should be failsafe, e.g. wrap the command properly.
  • the other packages should follow the debian/ubuntu packaging

Thanks
Martin

Here is some more info on the versions:

# apt show geonode
Package: geonode
Version: 2.8.0+thefinal1

more /etc/apt/sources.list.d/geonode-ubuntu-stable-xenial.list 
deb http://ppa.launchpad.net/geonode/stable/ubuntu xenial main
# deb-src http://ppa.launchpad.net/geonode/stable/ubuntu xenial main

apt-cache policy python-django
python-django:
  Installed: (none)
  Candidate: 1.8.19-1
  Version table:
     1.8.19-1 500
        500 http://ppa.launchpad.net/geonode/stable/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/geonode/stable/ubuntu xenial/main i386 Packages
     1.8.7-1ubuntu5.6 500
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages
        500 http://ftp-stud.hs-esslingen.de/ubuntu xenial-updates/main amd64 Packages
        500 http://ftp-stud.hs-esslingen.de/ubuntu xenial-updates/main i386 Packages
@afabiani afabiani added the major A high priority issue which might affect a lot of people or large parts of the codebase label Sep 25, 2018
@afabiani
Copy link
Member

@Marwe thanks for the detailed analysis. Currently, no active developer has yet found enough time to refactor the deb packages. Hopefully, we will be able at least to fix some of the known bugs for the next release. Tests and reports on usage are always very useful and welcomed.

@Marwe
Copy link
Author

Marwe commented Sep 25, 2018

Thanks for looking at it!
Maybe it should not be a recommended install method then, and the documentation should include at least a warning or that part could be removed.

@afabiani
Copy link
Member

@Marwe yes, I agree with you.

@t-book
Copy link
Contributor

t-book commented Nov 3, 2018

@afabiani Sounds maybe a bit radical but I would vote to remove Windows Installer + Apt completely from installation docs and geonode.org by now. This would prevent putting new Users down the wrong track and keep docs clean without "sorry this does not work right now" notes.

Maybe that´s something to discuss at the next PSC meeting? (I could offer to care about docs/restoring instructions when apt can be suggested again)

@afabiani
Copy link
Member

afabiani commented Nov 5, 2018

+1
this is something I wanted to do since a long time as we have no resources to maintain them actually.

@capooti
Copy link
Member

capooti commented Nov 5, 2018

+1 definitely

@simod
Copy link
Member

simod commented Jun 12, 2019

The ubuntu packages will not be maintained anymore unless someone is willing to actively contribute to it. This is now considered obsolete. A ubuntu package would probably require a complete rebuild.

@simod simod closed this as completed Jun 12, 2019
@abersh
Copy link

abersh commented May 8, 2021

I installed Geonode 3.2.0 on ubuntu server 18.04 by docker it works fine but after a hours "502 bad gateway nginx/1.17.2 on geonode" please anyone help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major A high priority issue which might affect a lot of people or large parts of the codebase
Projects
None yet
Development

No branches or pull requests

6 participants