[SOLVED] Unable to Reinstall NextCloud: The Login is already being used

I ran into a problem with NextCloud. I should have addressed it here when that happened, but decided to reinstall instead. I am unable to reinstall because The Login is already being used. How can I get to a state where I can reinstall NextCloud. Here’s the error log:

Error installing app: Command '['podman', 'exec', '--user', '33', 'nextcloud-freedombox', '/var/www/html/occ', 'maintenance:install', '--database=mysql', '--database-host=localhost:/run/mysqld/mysqld.sock', '--database-name=nextcloud_fbx', '--database-user=nextcloud_fbx', '--database-pass=dHqkyfo8sXElk9Ea', '--admin-user=nextcloud-admin', '--admin-pass=nhnrgPm2mZexuZUB']' returned non-zero exit status 1. Details
Error running action: nextcloud..setup(): CalledProcessError(1, ["podman", "exec", "--user", "33", "nextcloud-freedombox", "/var/www/html/occ", "maintenance:install", "--database=mysql", "--database-host=localhost:/run/mysqld/mysqld.sock", "--database-name=nextcloud_fbx", "--database-user=nextcloud_fbx", "--database-pass=dHqkyfo8sXElk9Ea", "--admin-user=nextcloud-admin", "--admin-pass=nhnrgPm2mZexuZUB"])
Stdout:
β”‚ nextcloud-freedombox
β”‚ 7321dd21730d95c56a2cc42b74a0d325bb8a6a9f094a225c8a66d2b451f92da8
β”‚ 
β”‚ The Login is already being used
Stderr:
β•‘ Failed to stop nextcloud-freedombox-volume.service: Unit nextcloud-freedombox-volume.service not loaded.
β•‘ Trying to pull registry.freedombox.org/library/nextcloud:stable-fpm...
β•‘ Getting image source signatures
β•‘ Copying blob sha256:a43e1d7835c4fc081e436364df7b82ca457b323bbeb3176305a7081b59519093
β•‘ Copying blob sha256:59e22667830bf04fb35e15ed9c70023e9d121719bb87f0db7f3159ee7c7e0b8d
β•‘ Copying blob sha256:9dc635c2027228aa873308d83180c9239808ceabf5b98612d4960a40576f004f
β•‘ Copying blob sha256:dc41ba52a2671ccdd6ccd0279fdbf176d7cdf19329b0fbde3a85367b81eb726b
β•‘ Copying blob sha256:bb1459239e282ffde81614e27fd405b6d149909b8ebd9b70bb5ce0195215ca2a
β•‘ Copying blob sha256:09b26bd3a372cc48b903ccc6ba86f93629260b8d428b3cc79720cf9460b23952
β•‘ Copying blob sha256:71b5ea08aba9ca343b8dfb49d0b48324a6b6a8c5f23a04bcbaa0279723b344a2
β•‘ Copying blob sha256:9ebf48d088de2dbfb48748c2a80ca123107ef9965b51d5f61d9413cef69a5399
β•‘ Copying blob sha256:afa41e6ecc61acd4872917176d8a5474880885fe178ce1883bbf130aab32d55f
β•‘ Copying blob sha256:813270098eebafdc221a72a13cada4ff4b60ac6caa40045735da1cb5756af8d0
β•‘ Copying blob sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
β•‘ Copying blob sha256:430f13f728662e783a2b81d9db49eb86a4a6c89b440f435489d5b4de936bbe9b
β•‘ Copying blob sha256:ff551e6ce2893f185a628d05f97fcb2fa3b6fe0722e8bbeae371d41befbcbeb0
β•‘ Copying blob sha256:7129c5346f45aca9e26d6729032169bf99cae2e6b2a637d79659224fd640d74f
β•‘ Copying blob sha256:ff8255f606a9981ec48b1cbf7918da2e750cbff52eb989f5281446bd370e13ea
β•‘ Copying blob sha256:0ce349dc8249c8205c0ec69b804e160a08dd18bde1675edf6535ef2b266bca43
β•‘ Copying blob sha256:eea0fdd800c6fed59f14acface86b39771d1359dda552f8d1262c20647ae23a7
β•‘ Copying blob sha256:06508471633c32d375819dd0ff786c1b3c9ebaff982faeccf1631d641a87e9a1
β•‘ Copying config sha256:7321dd21730d95c56a2cc42b74a0d325bb8a6a9f094a225c8a66d2b451f92da8
β•‘ Writing manifest to image destination
β•‘ Storing signatures
Action traceback:
β•ž   File "/usr/lib/python3/dist-packages/plinth/actions.py", line 398, in _privileged_call
β•ž     return_values = func(*arguments['args'], **arguments['kwargs'])
β•ž                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
β•ž   File "/usr/lib/python3/dist-packages/plinth/modules/nextcloud/privileged.py", line 69, in setup
β•ž     _nextcloud_setup_wizard(database_password)
β•ž   File "/usr/lib/python3/dist-packages/plinth/modules/nextcloud/privileged.py", line 257, in _nextcloud_setup_wizard
β•ž     _run_occ('maintenance:install', '--database=mysql',
β•ž   File "/usr/lib/python3/dist-packages/plinth/modules/nextcloud/privileged.py", line 87, in _run_occ
β•ž     return _run_in_container('/var/www/html/occ', *args, **kwargs)
β•ž            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
β•ž   File "/usr/lib/python3/dist-packages/plinth/modules/nextcloud/privileged.py", line 82, in _run_in_container
β•ž     return subprocess.run(command, capture_output=capture_output, check=check)
β•ž            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
β•ž   File "/usr/lib/python3.11/subprocess.py", line 571, in run
β•ž     raise CalledProcessError(retcode, process.args,

Hi @nomadicoder , to uninstall Nextcloud manually and remove all data/traces of it, run the following as root:

systemctl enable --now mysqld.service 
echo "DROP DATABASE nextcloud_fbx;" | mysql -u root
podman volume rm --force nextcloud-freedombox
podman image rm --ignore registry.freedombox.org/library/nextcloud:stable-fpm
rm -f /etc/containers/systemd/nextcloud-freedombox.volume
rm -f /etc/containers/systemd/nextcloud-freedombox.container
rm -rf /etc/systemd/system/netcloud-freedombox.service
rm -rf /var/lib/nextcloud/
systemctl daemon-reload

After this you should be able to install Nextcloud freshly without any old lingering data.

Also, if you are able to reproduce the problem, let us know how.

@Sunil , Thanks. This mostly worked, but I was unable to delete the NextCloud volume or image because the nextcloud-freedombox was running. I attempted to stop the container but it automatically restarted. I stopped and disabled the nextcloud-freedombox service with:

systemctl stop nextcloud-freedombox
systemctl disable nextcloud-freedombox

After that I was able to delete the volume and image, and successfully installed NextCloud.

1 Like