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

XWIKI-22503: xwiki-<database>-common install fail when cancelling dbconfig #3497

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

sid3windr
Copy link
Contributor

When upgrading the xwiki-mysql-common package, an error in the postinst script can be observed in specific cases:

Unpacking xwiki-mysql-common (16.7.1) over (16.7.1) ... Setting up xwiki-mysql-common (16.7.1) ...
dbconfig-common: writing config to /etc/dbconfig-common/xwiki.conf dbconfig-common: flushing administrative password
/var/lib/dpkg/info/xwiki-mysql-common.postinst: line 23: return: can only `return' from a function or sourced script dpkg: error processing package xwiki-mysql-common (--configure):
installed xwiki-mysql-common package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
xwiki-mysql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

This commit fixes return to be exit.

Jira URL

Changes

Description

Clarifications

Screenshots & Video

Executed Tests

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    *

When upgrading the xwiki-mysql-common package, an error in the postinst script can be observed in specific cases:

Unpacking xwiki-mysql-common (16.7.1) over (16.7.1) ...
Setting up xwiki-mysql-common (16.7.1) ...
dbconfig-common: writing config to /etc/dbconfig-common/xwiki.conf
dbconfig-common: flushing administrative password
/var/lib/dpkg/info/xwiki-mysql-common.postinst: line 23: return: can only `return' from a function or sourced script
dpkg: error processing package xwiki-mysql-common (--configure):
 installed xwiki-mysql-common package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 xwiki-mysql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

This commit fixes return to be exit.
@tmortagne
Copy link
Member

tmortagne commented Sep 12, 2024

specific cases

Was it a reinstall or a cancelled dbconfig in your case ? We generally create an issue on https://jira.xwiki.org/browse/XWIKI to associate it with the commit to have a better traceability from the release note to the commit.

@sid3windr
Copy link
Contributor Author

This happened on every package upgrade since I installed the package a few months ago (had to edit postinst every time). Because I wanted to capture the error, in this case it was apt-get --reinstall install xwiki-mysql-common. I don't have an xwiki JIRA account yet, but I can make one to create an issue if it's needed...

@tmortagne
Copy link
Member

tmortagne commented Sep 12, 2024

This happened on every package upgrade since I installed the package a few months ago

Well, this part of the script is very old, and it's the first time someone report a problem like this. Maybe you refused dbconfig back then and it's disabled for good, for upgrades too.

I don't have an xwiki JIRA account yet, but I can make one to create an issue if it's needed...

I can create it, but I wanted more detail about what exactly is the use case to put on it.

@sid3windr
Copy link
Contributor Author

As far as I remember, I declined to use dbconfig (db is created and managed by Puppet, package is also installed by Puppet), I guess everyone else uses it so $dbc_install is true for everyone except me?

I could try to install on a test box with some more detail...

@tmortagne
Copy link
Member

tmortagne commented Sep 12, 2024

I guess everyone else uses it so $dbc_install is true for everyone except me?

That's what I'm expecting the difference to be, yes. So I will create an issue related to a cancelled dbconfig.

Edit: https://jira.xwiki.org/browse/XWIKI-22503

@tmortagne tmortagne changed the title Avoid bash error in postinst XWIKI-22503: xwiki-<database>-common install fail when cancelling dbconfig Sep 12, 2024
@tmortagne tmortagne merged commit 0ddf703 into xwiki:master Sep 12, 2024
1 check passed
tmortagne pushed a commit that referenced this pull request Sep 12, 2024
tmortagne pushed a commit that referenced this pull request Sep 12, 2024
tmortagne pushed a commit that referenced this pull request Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants