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

[enh] Check if dpkg is not broken when calling ynh_wait_dpkg_free #638

Merged
merged 1 commit into from Feb 19, 2019

Conversation

Projects
None yet
4 participants
@maniackcrudelis
Copy link
Contributor

maniackcrudelis commented Jan 31, 2019

The problem

Fix YunoHost/issues#1284

Solution

Use the way apt check that dpkg is available to know if dpkg --configure -a is needed.

PR Status

Ready to be reviewed.

How to test

As Aleks told me, update metronome or any other package that will ask you to replace a config file. And kill the process without answering the question.
Then, remove the lock file and you'll have a broken dpkg

Validation

  • Principle agreement 0/2 :
  • Quick review 0/1 :
  • Simple test 0/1 :
  • Deep review 0/1 :
@Psycojoker

This comment has been minimized.

Copy link
Member

Psycojoker commented Jan 31, 2019

Shouldn't we run sudo dpkg --configure -a instead of breaking the install? I don't know if it's a good idea.

I have a concern because people that only uses the admin interface won't be able to do that by themselves but that's really out of the scope of this PR.

@alexAubin

This comment has been minimized.

Copy link
Member

alexAubin commented Jan 31, 2019

It won't solve the issue. For instance, in the case of the metronome upgrade, it excepts to interact with the user so that it can choose what version of the config to choose ... That's one example but there might be other situation (e.g. not being able to install a package because it cant override a file, c.f. labriqueinternet/hotspot_ynh#30 )

So there isn't really any obvious general automatic fix :/ But at least diagnosing what the actual issue is shall make support faster.

(For the anecdote : I reported this after a friend was not able to install an app. Then he ended up trying to install all conf files by hand because he thought the app was broken. Turns out it was just the metronome thing which broke apt :/)

@Psycojoker

This comment has been minimized.

Copy link
Member

Psycojoker commented Jan 31, 2019

Meh, ok x(

I don't know how we are going to make this solvable on the admin one day :/

@alexAubin

This comment has been minimized.

Copy link
Member

alexAubin commented Jan 31, 2019

Yea :s I guess the best lead so far is to avoid breaking apt in the first place 😅

@Psycojoker

This comment has been minimized.

Copy link
Member

Psycojoker commented Jan 31, 2019

If we want to explore real solutions we have pexpect for that and probably some dpkg python integration or ... maybe something in that horrible python-apt 😓

@alexAubin
Copy link
Member

alexAubin left a comment

LGTM, though I would really like to implement this directly in the core so that people get this message right away before even entering in the app install script

@alexAubin alexAubin added this to the 3.5.x milestone Feb 5, 2019

@maniackcrudelis

This comment has been minimized.

Copy link
Contributor Author

maniackcrudelis commented Feb 15, 2019

@JimboJoe
Copy link
Member

JimboJoe left a comment

LGTM (at least that's a step forward!) 👍

@maniackcrudelis

This comment has been minimized.

Copy link
Contributor Author

maniackcrudelis commented Feb 17, 2019

Let's merge in 3 days if it's ok

@alexAubin alexAubin referenced this pull request Feb 18, 2019

Open

[enh] Assert dpkg is not broken before app install #652

0 of 4 tasks complete

@alexAubin alexAubin changed the title Check if dpkg is broken [enh] Check if dpkg is not broken when calling ynh_wait_dpkg_free Feb 18, 2019

@alexAubin alexAubin merged commit b63c33d into stretch-unstable Feb 19, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@alexAubin alexAubin deleted the broken_dpkg branch Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment