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

App Update Required - Music - Cannot login to Nextcloud server #889

Closed
martinbook85 opened this issue Aug 31, 2021 · 15 comments
Closed

App Update Required - Music - Cannot login to Nextcloud server #889

martinbook85 opened this issue Aug 31, 2021 · 15 comments

Comments

@martinbook85
Copy link

As subject states I am forced to update an app and otherwise I cannot login.

When I try to update the app there is an error message.

I am not on the newest Nextcloud, maybe on NC 19 or 20.

This is what comes up

uponsignin

AppUpdate

@paulijar
Copy link
Collaborator

Sorry for the problem, this seems to be the same issue as #883. The bug is that updating directly from Music < 1.0.0 to version >=1.2.1 doesn't work on Nextcloud. You could try to first install https://github.com/owncloud/music/releases/tag/v1.2.0 and then retry with the v1.3.1. Alternatively, drop all DB-content related to the Music app like described in that linked issue, but then you will lose any user-created playlists and be forced to rescan the library.

I shall make a fix for the underlying issue, but it will probably take at least a few days before I can do that.

@martinbook85
Copy link
Author

How do I install 1.2.0 first and then install the other? Is there an occ command?

I haven't really used it much because I don't have any music on nextcloud yet, what would be the command to type to remove all DB-content?

Thanks for your assistance!

Cordially,
Martin

@paulijar
Copy link
Collaborator

You should be able to install the old version like this:

  1. Download https://github.com/owncloud/music/releases/download/v1.2.0/music_1.2.0_nc-signed.tar.gz
  2. Extract the package under <path_to_nextcloud>/apps (overriding the music folder already there)
  3. Then, assuming your web server uses username www-data, execute under your nextcloud folder
sudo -u www-data ./occ app:disable music
sudo -u www-data ./occ app:enable music
  1. The old version should now be installed, and you should be able to enter the web UI.
  2. Then update the Music app again to the latest version normally via the app management
  • If this doesn't work, then the chances are that there is some file permission issue on the music files after the manual install. Make sure that www-data (or whatever the web server user is) owns all the files under apps/music.

For the DB management stuff, do you know how to access the console of your database management system? Which database system is that? Are you at all familiar with the SQL syntax?

@martinbook85
Copy link
Author

I cannot find a folder "music" under /path to nextcloud/apps, I do not even have that folder. There is a folder /apps under /nextcloud/html/apps. But there is no folder called "music" though many other apps seem to have a folder there.

Could it be under Nextcloud/data/ ?

@paulijar
Copy link
Collaborator

paulijar commented Sep 1, 2021

Interesting, I didn't know that the location of the installed apps in the directory tree may vary on Nextcloud. You could try find -name music to locate the folder.

Looking at the nextcloud sample config.php file, there seems to be the key 'apps_paths' which can be used to set apparently one or more possible directory paths for the applications.

@martinbook85
Copy link
Author

I found it, it was under
/home/nightramcobe/nextcloud/html/custom_apps/

I was not able to extract the files to that folder, but extracted it in Downloads, deleted the music folder in the path above and then moved the new folder into its place.

I then tried the command you suggested but it just said
./occ: command not found
Tried with usual occ app:disable in the root directory but that changed nothing, unfortunately. The same error as before:

occ app:disable music
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
An exception occurred while executing 'UPDATE oc_appconfig SET configvalue = ? WHERE (appid = ?) AND (configkey = ?) AND ((configvalue IS NULL) OR (configvalue <> ?))' with params ["no", "music", "enabled", "no"]:

SQLSTATE[HY000]: General error: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.

@paulijar
Copy link
Collaborator

paulijar commented Sep 1, 2021

I then tried the command you suggested but it just said ./occ: command not found

I'm a bit confused, what's your usual way to run occ? Anyway, if you can run it with your method, then that should be fine.

Looking at that last error message, would this be relevant for your case: https://techoverflow.net/2021/08/17/how-to-fix-nextcloud-4047-innodb-refuses-to-write-tables-with-row_formatcompressed-or-key_block_size/ ? Are you running Nextcloud in a docker container? That's something I'm not familiar with and may have some quirks I'm not aware of.

@martinbook85
Copy link
Author

martinbook85 commented Sep 1, 2021

Yes, Docker. The only way I was able to figure it out.

Thank you for doing so much to help me solve the problem.

If I understand this correctly I should just edit my docker yml file and add the following:

--transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed

I will try and see if it works and let you know asap.

@martinbook85
Copy link
Author

Or rather this full text:

nextcloud-db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
restart: always
volumes:
- ./nextcloud-db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}

@martinbook85
Copy link
Author

It didn't help :-(

I do not know what to do now...

paulijar added a commit to paulijar/music that referenced this issue Sep 2, 2021
When defining the DB schema for Nextcloud was moved to use the
migrations mechanism in v1.2.1 (commit 6982d91), a problem was
introduced: The migration worked only either on a clean database (no
earlier versions of Music installed) or on v1.0.0 or newer. Installing
over any v0.x.y got broken. This was because the auto-generated
migration script Version010200Date20210513171803 newer altered the DB
schema of existing tables; it just created tables which were missing.

The not so well-working migration script has now been replaced with the
hand-written Version010000Date20210903000000. This script checks
separately that each needed column exists in the database and creates
the missing ones. It also removes couple of obsolete columns (removed
over the years) if those are still present in the database.

This new script should be able to migrate the database from any version
starting from v0.4.0 to the v1.0.0 level. Most of these versions have
not been tested, though.

refs owncloud#889
refs owncloud#883
@paulijar
Copy link
Collaborator

paulijar commented Sep 2, 2021

There seems to be a lot of discussion about the 4047 InnoDB problem also here: https://help.nextcloud.com/t/update-to-next-cloud-21-0-2-has-get-an-error/117028
I didn't read that all, but apparently some people had solved such issue by downgrading their MariaDB to an older version.

@martinbook85
Copy link
Author

Thanks! I will keep looking. :-)

@martinbook85
Copy link
Author

As solved here: https://help.nextcloud.com/t/music-app-stuck-without-being-able-to-update-general-error-4047-innodb/122845

For anyone following this hitting an error like:

SQLSTATE[HY000]: General error: 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.

… This is due to an issue with new versions of MariaDB. Full details can be found in this thread .

The solution is to add the following to the mariadb portion of your docker-compose.yml:

command: ['--innodb_read_only_compressed=OFF']

For example:

  mariadb:
    image: mariadb
    container_name: nextcloud-mariadb
    restart: unless-stopped
    command: ['--innodb_read_only_compressed=OFF']
    volumes:
      - ${NEXTCLOUD_ROOT}/mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    networks:
      - nextcloud

@martinbook85
Copy link
Author

Thank you Paulijar for trying to help!

@paulijar
Copy link
Collaborator

paulijar commented Sep 5, 2021

The application update over any older Music (database) version should now work with Music v1.3.2.

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

No branches or pull requests

2 participants