BVD Posted September 11, 2022 Share Posted September 11, 2022 (edited) 21 minutes ago, elco1965 said: Hi guys, I had a some issues with the docker image. I spent some time trying to fix it and then decide to delete and rebuild. I reinstalled the containers I wanted and everything is working well aside from one problem. I had installed Two-Factor TOTP Provider from the Nextcloud App store prior to the docker image rebuild. Now when I log into Nextcloud I am not prompted for the TOTP code but I have access with only user and password. I have tried to reinstall the TOTP App but get this error. The column 'last_counter' on table 'oc_twofactor_totp_secrets' already exists. I have tried to disable and remove the app restarting the container each time. I feel as if this is somewhere not in the app data folder but rather in the Nextcloud share where the user data is stored. In the user data share I did find and deleted a folder named "2factor" after disabling and removing the app from within the Nextcloud UI. I have attached the config file. Thanks in advance for the help. config.php You're going to want to step through nextcloud's documentation regarding database maintenance/repair - it's possible the version of the totp plugin youd previously used was older than the current one, or that theres another mismatch between versions of dependent applications (before the wipe vs current). In either case, the application isnt seeing what it expects from the DB. I'd first try the `maintenance:repair` command they've documented, along with verifying the indices are all there (should be an `add-missing` option documented in the same place). If that still fails, I'd check your logs to validate what version you previously had installed and then manually remove/clean up the current TOTP package, replacing it with that specific version from github. EDIT: Just thinking about this more, its relatively likely that the above will fail... in which case your only remaining options would be to A. Try disabling the totp provider from the cli, and if successful, then reinstall. If that gives you an error... B. Add missing primary keys (it's another db:add-missing blah blah type deal) C. Manually run the db migration to bring the DB schema up to date - think it's something like "migrations:migrate totp", something like that anyway - should be able to find it in nextclouds dev docs. D. Last, and certainly most drastic measure: Manually drop/delete all totp related tables from the DB, then reattempt install. Should go without saying, but make sure you've a solid backup first, and before attempting any of the above, enable maintenance mode. Edited September 11, 2022 by BVD My first suggestions were dumb Quote Link to comment
4554551n Posted September 11, 2022 Share Posted September 11, 2022 On 9/10/2022 at 1:42 AM, JakBar said: Ive been keeping the docker container updated but now I am getting this error below. I am very new to this, I followed Space invaders guide back in November and have ngnix setup. It wont actually start and keeps repeating the last two lines. Repo: lscr.io/linuxserver/nextcloud I rolled back to an older version so my wife can still do stuff in nextcloud, still see the last two lines but it runs. Any help for a noob like me would be great [custom-init] 20-install-glib.sh: exited 0 [custom-init] README.txt: executing... /config/custom-cont-init.d/README.txt: line 1: data: command not found /config/custom-cont-init.d/README.txt: line 2: data: command not found /config/custom-cont-init.d/README.txt: line 3: data: command not found /config/custom-cont-init.d/README.txt: line 4: data: command not found /config/custom-cont-init.d/README.txt: line 5: data: command not found /config/custom-cont-init.d/README.txt: line 6: data: command not found /config/custom-cont-init.d/README.txt: line 7: data: command not found /config/custom-cont-init.d/README.txt: line 8: data: command not found /config/custom-cont-init.d/README.txt: line 9: data: command not found /config/custom-cont-init.d/README.txt: line 10: data: command not found /config/custom-cont-init.d/README.txt: line 11: data: command not found /config/custom-cont-init.d/README.txt: line 12: data: command not found /config/custom-cont-init.d/README.txt: line 13: data: command not found /config/custom-cont-init.d/README.txt: line 14: data: command not found [custom-init] README.txt: exited 127 ******************************************************** ******************************************************** * * * !!!! * * Custom scripts or services found in legacy locations * * !!!! * * Please move your custom scripts and services * * to /custom-cont-init.d and /custom-services.d * * respectively to ensure they continue working. * * * * Visit https://linuxserver.io/custom for more info. * * * ******************************************************** ******************************************************** cont-init: info: /etc/cont-init.d/99-custom-files exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-mods: starting s6-rc: info: service init-mods successfully started s6-rc: info: service init-mods-package-install: starting s6-rc: info: service init-mods-package-install successfully started s6-rc: info: service init-mods-end: starting s6-rc: info: service init-mods-end successfully started s6-rc: info: service init-services: starting s6-rc: info: service init-services successfully started s6-rc: info: service custom-svc-README.txt: starting s6-supervise custom-svc-README.txt (child): fatal: unable to exec run: Exec format error s6-supervise custom-svc-README.txt: warning: unable to spawn ./run - waiting 10 seconds I am having a similar issue, probably the same cause. Docker won't start, getting errors about this file. It looks like it wants /etc/s6-overlay/s6-rc.d/user/contents.d/custom-svc-README.txt/run to be an executable script, shebang and all. But it's just that message and it can't execute it. I THINK. Though how to fix it, no idea. Still struggling. Deleting it and restarting the containter, it goes straight back. Deleting it, or the entire /etc/s6-overlay/s6-rc.d/user/contents.d/custom-svc-README.txt while it's running also doesn't work. I would really like to know the fix too Quote Link to comment
BVD Posted September 11, 2022 Share Posted September 11, 2022 4 minutes ago, 4554551n said: I am having a similar issue, probably the same cause. Docker won't start, getting errors about this file. It looks like it wants /etc/s6-overlay/s6-rc.d/user/contents.d/custom-svc-README.txt/run to be an executable script, shebang and all. But it's just that message and it can't execute it. I THINK. Though how to fix it, no idea. Still struggling. Deleting it and restarting the containter, it goes straight back. Deleting it, or the entire /etc/s6-overlay/s6-rc.d/user/contents.d/custom-svc-README.txt while it's running also doesn't work. I would really like to know the fix too It's trying to execute a .txt file as a service? A reader no less? Seems weird. You open up the read readme to see what its saying/doing? Assuming you checked permissions already of course (and that the answer isn't just the readme contents), I'd hit up the github and look for other reports; this thread has mostly become a more generalized nextcloud applicarion support thread over the last year or two, while the repo is specific to the containers implementation of NC (and this is a container issue, based on the description at least). Quote Link to comment
4554551n Posted September 11, 2022 Share Posted September 11, 2022 (edited) Ok, I have a fix with the help of one Spad from the discord chat. So. 1. Stop nextcloud docker 2. Create new /appdata folder as /appdata/nextcloud-custom 3. Move /appdata/nextcloud/custom-cont-init.d and custom-services.d there with their contents, but make sure they're root owned 4. Delete readme files from both of those folders 5. In the docker settings, create 2 new volume mounts, pointing to those locations. -container path /custom-services.d -/mnt/user/appdata/nextcloud-custom/custom-services.d-fix/ -Same for cont-init -Make sure they are both read only 6. Start docker They've made a change where they now look for files in that old location and if it's there, generate that log message. There is a bug where that log message tries to be read as a script, fails, and we get what we get. A fix is in the pipe. Be sure you deleted the readme files from the folders, or it'll generate a slightly different, but related error. If you skipped the step, do it, then you have to go into docker settings, and force an update on the container to get unraid to recreate it. Edited September 11, 2022 by 4554551n Quote Link to comment
elco1965 Posted September 11, 2022 Share Posted September 11, 2022 15 hours ago, BVD said: You're going to want to step through nextcloud's documentation regarding database maintenance/repair - it's possible the version of the totp plugin youd previously used was older than the current one, or that theres another mismatch between versions of dependent applications (before the wipe vs current). In either case, the application isnt seeing what it expects from the DB. I'd first try the `maintenance:repair` command they've documented, along with verifying the indices are all there (should be an `add-missing` option documented in the same place). If that still fails, I'd check your logs to validate what version you previously had installed and then manually remove/clean up the current TOTP package, replacing it with that specific version from github. EDIT: Just thinking about this more, its relatively likely that the above will fail... in which case your only remaining options would be to A. Try disabling the totp provider from the cli, and if successful, then reinstall. If that gives you an error... B. Add missing primary keys (it's another db:add-missing blah blah type deal) C. Manually run the db migration to bring the DB schema up to date - think it's something like "migrations:migrate totp", something like that anyway - should be able to find it in nextclouds dev docs. D. Last, and certainly most drastic measure: Manually drop/delete all totp related tables from the DB, then reattempt install. Should go without saying, but make sure you've a solid backup first, and before attempting any of the above, enable maintenance mode. Thanks for the advise. I am not very good with cli but I managed to drop the table Then I got this error So i researched this and tried to discard the tablespace. This returned an error telling me the tablespace it wants me to discard doesn't exist. I've been going around like this for hours now. Quote Link to comment
BVD Posted September 12, 2022 Share Posted September 12, 2022 1 hour ago, elco1965 said: Thanks for the advise. I am not very good with cli but I managed to drop the table Then I got this error So i researched this and tried to discard the tablespace. This returned an error telling me the tablespace it wants me to discard doesn't exist. I've been going around like this for hours now. I'm assuming you tried all the other steps first, correct? Did the repair / occ steps above all come through clean? Manually editing the DB should be a last ditch effort, and youd likely want to walk through the totp plugin dev information to ensure that's handled properly- it's almost a certainty that theres fields in other tables which are reliant upon that one, and thatd be the easiest way to locate them with any certainty (imo anyway) unless others have documented the steps previously. Quote Link to comment
elco1965 Posted September 12, 2022 Share Posted September 12, 2022 (edited) 14 hours ago, BVD said: I'm assuming you tried all the other steps first, correct? Did the repair / occ steps above all come through clean? Manually editing the DB should be a last ditch effort, and youd likely want to walk through the totp plugin dev information to ensure that's handled properly- it's almost a certainty that theres fields in other tables which are reliant upon that one, and thatd be the easiest way to locate them with any certainty (imo anyway) unless others have documented the steps previously. Thanks again for your time It is indeed the same version. Here is a list of the commands I ran and what was returned. Ran this fisrt occ app:list Found the twofactor_totp app in the list and ran occ app:disable twofactor_totp And then occ app:enable twofactor_totp That returned An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1813 Tablespace for table '`nextcloud`.`oc_twofactor_totp_secrets`' exists. Please DISCARD the tablespace before IMPORT Then occ db:add-missing-indices which returns in green Check indices of the share table. Check indices of the filecache table. Check indices of the twofactor_providers table. Check indices of the login_flow_v2 table. Check indices of the whats_new table. Check indices of the cards table. Check indices of the cards_properties table. Check indices of the calendarobjects_props table. Check indices of the schedulingobjects table. Check indices of the oc_properties table. Check indices of the oc_jobs table. Check indices of the oc_direct_edit table. Done. then this occ migrations:migrate twofactor_totp Which returned this highlighted in red There are no commands defined in the "migrations" namespace. Reading through this document https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html?highlight=db+add+missing# I did not find anything about migrations. I did some web searching but couldn't put a migration command together that worked. I am not well versed with command line interface and don't really now what to do with the migration command. This is when I attempted to drop the table in mariadb docker via cli which returned the frustrating circle of dismay I showed in my earlier post. I also ran the following and it reports back 0 removed. [email protected]:/# occ app:disable twofactor_totp No such app enabled: twofactor_totp [email protected]:/# occ app:REMOVE twofactor_totp twofactor_totp disabled twofactor_totp 0 removed Edited September 12, 2022 by elco1965 Quote Link to comment
elco1965 Posted September 12, 2022 Share Posted September 12, 2022 15 hours ago, elco1965 said: Thanks again for your time It is indeed the same version. Here is a list of the commands I ran and what was returned. Ran this fisrt occ app:list Found the twofactor_totp app in the list and ran occ app:disable twofactor_totp And then occ app:enable twofactor_totp That returned An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1813 Tablespace for table '`nextcloud`.`oc_twofactor_totp_secrets`' exists. Please DISCARD the tablespace before IMPORT Then occ db:add-missing-indices which returns in green Check indices of the share table. Check indices of the filecache table. Check indices of the twofactor_providers table. Check indices of the login_flow_v2 table. Check indices of the whats_new table. Check indices of the cards table. Check indices of the cards_properties table. Check indices of the calendarobjects_props table. Check indices of the schedulingobjects table. Check indices of the oc_properties table. Check indices of the oc_jobs table. Check indices of the oc_direct_edit table. Done. then this occ migrations:migrate twofactor_totp Which returned this highlighted in red There are no commands defined in the "migrations" namespace. Reading through this document https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html?highlight=db+add+missing# I did not find anything about migrations. I did some web searching but couldn't put a migration command together that worked. I am not well versed with command line interface and don't really now what to do with the migration command. This is when I attempted to drop the table in mariadb docker via cli which returned the frustrating circle of dismay I showed in my earlier post. I also ran the following and it reports back 0 removed. [email protected]:/# occ app:disable twofactor_totp No such app enabled: twofactor_totp [email protected]:/# occ app:REMOVE twofactor_totp twofactor_totp disabled twofactor_totp 0 removed I have considered nuking the instance and starting from scratch. But it is my suspicion that the problem I am having lies in the table in the database that is stored in the mariabd docker. I don't think a reinstall of Nextcloud will do the trick. Quote Link to comment
BVD Posted September 12, 2022 Share Posted September 12, 2022 8@elco1965agree - traveling currently, I'll take a deeper look once freed up 1 Quote Link to comment
Aluavin Posted September 13, 2022 Share Posted September 13, 2022 Hi, my Nextcloud was working previously. However the current update breaks it in a way where I cant access my Files right now - which is an issue. Nextcloud runs on the Domain https://nextcloud.domain.tld/updater/ I'm running the mentioned docker and tried to update nextcloud withing the UI. However It won't do the job. I'm stuck at Step 6 is currently in process. Please reload this page later. So I I tried to searh a bit on how to fix it. It's also mentioned in this thread here, however the only suggestion was "give it a little time" - which doesnt work for me because this message appeard for like a week. Generally it seems like deleting the File within the docker /data/updater-xxxxxx/.step will bring you back to the Updater - which is a step backwards, but it is working. Than set in in the appdater/nextcloud/www/nextcloud/config/config.php the parameter 'maintenance' => false, However, If I make a request to to nextcloud dashboard I still see the message Update in progress. So all I can do is to head over https://nextcloud.domain.tld/updater/ and start the process again - which I did multiple times. I even ssh into the docker and renamed the /data/updater-xxxxxx to a different name. The Folder was than created successfull when I entered the /updater URL and ran the process. One suggestion which I also tried was to run occ - which doesnt run at all due to Could not open input file: /config/www/nextcloud/occ So I thought hey maybe a permission issue and googled. However, this file seems to only exsist within the Updater Folder, so when I run inside the folder [email protected]:/data/updater-oci1k05iuicv/downloads/nextcloud the command sudo -u abc php occ maintenance:mode it seem to work, so naturally I tried sudo -u abc php occ maintenance:mode Maintenance mode is currently disabled Which is the same which is noted in the unraid/appdata - File mentioned above. However, when I try to access the UI I still get the message Update in process. I am completly lost and a bit mad right now. Can someone please tell me on how I might get my instance back and running? I will check in later in here because it is 2:35 in my timezone and i have to start working in a couple of hours but I'll check in later. Quote Link to comment
BVD Posted September 13, 2022 Share Posted September 13, 2022 1 hour ago, Aluavin said: Hi, my Nextcloud was working previously. However the current update breaks it in a way where I cant access my Files right now - which is an issue. Nextcloud runs on the Domain https://nextcloud.domain.tld/updater/ I'm running the mentioned docker and tried to update nextcloud withing the UI. However It won't do the job. I'm stuck at Step 6 is currently in process. Please reload this page later. So I I tried to searh a bit on how to fix it. It's also mentioned in this thread here, however the only suggestion was "give it a little time" - which doesnt work for me because this message appeard for like a week. Generally it seems like deleting the File within the docker /data/updater-xxxxxx/.step will bring you back to the Updater - which is a step backwards, but it is working. Than set in in the appdater/nextcloud/www/nextcloud/config/config.php the parameter 'maintenance' => false, However, If I make a request to to nextcloud dashboard I still see the message Update in progress. So all I can do is to head over https://nextcloud.domain.tld/updater/ and start the process again - which I did multiple times. I even ssh into the docker and renamed the /data/updater-xxxxxx to a different name. The Folder was than created successfull when I entered the /updater URL and ran the process. One suggestion which I also tried was to run occ - which doesnt run at all due to Could not open input file: /config/www/nextcloud/occ So I thought hey maybe a permission issue and googled. However, this file seems to only exsist within the Updater Folder, so when I run inside the folder [email protected]:/data/updater-oci1k05iuicv/downloads/nextcloud the command sudo -u abc php occ maintenance:mode it seem to work, so naturally I tried sudo -u abc php occ maintenance:mode Maintenance mode is currently disabled Which is the same which is noted in the unraid/appdata - File mentioned above. However, when I try to access the UI I still get the message Update in process. I am completly lost and a bit mad right now. Can someone please tell me on how I might get my instance back and running? I will check in later in here because it is 2:35 in my timezone and i have to start working in a couple of hours but I'll check in later. Restore backup, then update via CLI would be your best bet - save you from hitting timeouts incurred by the UI updater 👍 Quote Link to comment
Josia Posted September 14, 2022 Share Posted September 14, 2022 Hello, I tried to update to 24.0.5, but now my web UI is stuck with this message Quote Update in process. But my real problem is I now want to restore from the backups made by the updater but every time I try to run occ Quote Could not open input file: occ Thanks in advance Quote Link to comment
FungShui Posted September 14, 2022 Share Posted September 14, 2022 According to the Database configuration of Nextcloud, the php client should be tuned by editing /etc/php7/conf.d/mysql.ini. Such as changing the following line: mysql.cache_size=2000 I wonder which file should I modify instead? Quote Link to comment
BVD Posted September 15, 2022 Share Posted September 15, 2022 On 9/12/2022 at 5:14 PM, BVD said: 8@elco1965agree - traveling currently, I'll take a deeper look once freed up Just letting you know, I've not forgotten about this, hoping to make it back tonight and look further following 👍 Quote Link to comment
elco1965 Posted September 15, 2022 Share Posted September 15, 2022 30 minutes ago, BVD said: Just letting you know, I've not forgotten about this, hoping to make it back tonight and look further following 👍 Hey thanks. I appreciate the note. Quote Link to comment
AmokK Posted September 22, 2022 Share Posted September 22, 2022 Hi ! I'm having an issue with my Nextcloud 24 instance, I get a "something went wrong" in the background tasks, that is 7 days old. It runs on default setting "Cron", i tried to switch to Webcron, to test if it got better, but it switches back automatically to Cron a few minutes later. What can I do to solve this problem ? Quote Link to comment
graphius Posted September 24, 2022 Share Posted September 24, 2022 I have set up a small unraid server with three SSD's in the array. I installed nextcloud with db etc and everything is working fine, except all files are saved in app data, instead of on the nextcloud share I made. I have confirmed the data path in the docker is set to the nextcloud share, but it still writes new files to app data. Any leads on how I can pin down the issue? Quote Link to comment
Mattaton Posted September 26, 2022 Share Posted September 26, 2022 I've had Nextcloud working fine for well over a year, but now my devices say the server is unavailable. Checking the server, NC is stuck in maintenance mode. If I manually turn maintenance mode off, the web ui then says there's an update to the mail app. When I try to update it, it says an error occurred and it goes back into maintenance mode. The "detailed logs" after the failed update says: Quote Preparing update Set log level to debug Turned on maintenance mode Repair step: Repair MySQL collation Repair info: All tables already have the correct collation -> nothing to do Repair step: Repair SQLite autoincrement Repair step: Copy data from accounts table when migrating from ownCloud Repair step: Drop account terms table when migrating from ownCloud Updating database schema Updated database An error occurred. So I'm stuck with either a mail update screen or a maintenance mode screen. Both result in a server that is unavailable/offline. I just updated to the latest nextcloud version, hoping that would knock out the issue, but no luck. I don't use the mail app, so I'm also fine if that could just be disabled to get around this. I still consider myself an unRAID/docker novice, but I can follow instructions. 😄 Thanks for any help! 1 Quote Link to comment
andreidelait Posted September 26, 2022 Share Posted September 26, 2022 After the last update nextcloud crashes my server completely. I only have access via SSH but no logs no nothig. I can't even access /mnt. I have to reboot from SSH and starts with parity check after. Is anyone having issues like this? I used this container for years now bot from time to time it comes to something like this. Quote Link to comment
STEFAN1987 Posted September 26, 2022 Share Posted September 26, 2022 38 minutes ago, andreidelait said: After the last update nextcloud crashes my server completely. I only have access via SSH but no logs no nothig. I can't even access /mnt. I have to reboot from SSH and starts with parity check after. Is anyone having issues like this? I used this container for years now bot from time to time it comes to something like this. Mine is also totally dead. i cant connect to the webui after i updated not locally or from https. I dont see anything in the log that seem unusual. I has worked like a charm right before last update Quote Link to comment
Ben4 Posted September 27, 2022 Share Posted September 27, 2022 (edited) Hello All, I a couple of days ago I updated the nextcloud docker and now the site is stuck at a Welcome to Our Server screen. I've been trying to troubleshoot myself, but have not found a solution. I did not change anything so I don't know what happened. There is nothing in the logs for nextcloud or swag that gives me a clue as to what the problem is. I updated nextcloud using the update command docker exec -it nextcloud updater.phar to the latest version 24.0.5 thinking that would fix it, but still nothing. I saw there was another docker update today and I ran that, but still the same Welcome to Our server message. Anyone know how to fix this? Edited September 27, 2022 by Ben4 Quote Link to comment
andreidelait Posted September 27, 2022 Share Posted September 27, 2022 4 hours ago, Ben4 said: Hello All, I a couple of days ago I updated the nextcloud docker and now the site is stuck at a Welcome to Our Server screen. I've been trying to troubleshoot myself, but have not found a solution. I did not change anything so I don't know what happened. There is nothing in the logs for nextcloud or swag that gives me a clue as to what the problem is. I updated nextcloud using the update command docker exec -it nextcloud updater.phar to the latest version 24.0.5 thinking that would fix it, but still nothing. I saw there was another docker update today and I ran that, but still the same Welcome to Our server message. Anyone know how to fix this? It's probably because of swag container. You have to add the .conf extension to your configuration files now. It wasn't the case before. Have a look at the logs of nextcloud and swag. Quote Link to comment
Ben4 Posted September 27, 2022 Share Posted September 27, 2022 @andreidelait Thank you. Once I added the .conf to my nextcloud config file my site came up. Much appreciated. Do you mind sharing the link with the documentation of this change. Quote Link to comment
andreidelait Posted September 27, 2022 Share Posted September 27, 2022 10 minutes ago, Ben4 said: @andreidelait Thank you. Once I added the .conf to my nextcloud config file my site came up. Much appreciated. Do you mind sharing the link with the documentation of this change. I remember mine specified this in the docker log. I don't have the exact documentation but I guess this is related: https://info.linuxserver.io/issues/2022-08-20-nginx-base/ Quote Link to comment
elco1965 Posted September 27, 2022 Share Posted September 27, 2022 On 9/15/2022 at 7:00 AM, BVD said: Just letting you know, I've not forgotten about this, hoping to make it back tonight and look further following 👍 I was able to get this sorted. For whatever reason I could not delete the table space "TOTP Secrets" via terminal. I was however able to delete it using the Krusader web ui. Seems to be working now. Thanks again for the help. Quote Link to comment
Recommended Posts
Posted by Squid,
1 reaction
Go to this post
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.