syncloud / platform

Run popular services on your device with one click
https://syncloud.org
GNU General Public License v3.0
400 stars 40 forks source link

nextcloud tmp not writable issue #326

Closed cyberb closed 6 years ago

cyberb commented 6 years ago

Happened once on one of the user's devices, cannot reproduce at the moment.

Sep 25 20:05:06 odroid-xu3and4 ownCloud[746]: {no app in context} Temporary directory /data/nextcloud/tmp is not present or writable
Sep 25 20:05:06 odroid-xu3and4 ownCloud[746]: {no app in context} Temporary directory /data/nextcloud/tmp is not present or writable
Sep 25 20:05:06 odroid-xu3and4 ownCloud[746]: {no app in context} Temporary directory /data/nextcloud/tmp is not present or writable
Sep 25 20:05:06 odroid-xu3and4 ownCloud[746]: {no app in context} Temporary directory /data/nextcloud/tmp is not present or writable
Sep 25 20:05:06 odroid-xu3and4 ownCloud[746]: {PHP} tempnam(): file created in the system's temporary directory at /snap/nextcloud/180831279/nextcloud/lib/private/TempManager.php#242
Sep 25 20:05:06 odroid-xu3and4 ownCloud[746]: {remote} Exception:
{"Exception":"UnexpectedValueException","Message":"Unable to detect
system temporary directory","Code":0,"Trace":"#0
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/TempManager.php(57):
OC\\TempManager->getTempBaseDir()\n#1
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/Server.php(680):
OC\\TempManager->__construct(Object(OC\\Log),
Object(OC\\AllConfig))\n#2
\/snap\/nextcloud\/180831279\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php(113):
OC\\Server->OC\\{closure}(*** sensitive parameters replaced ***)\n#3
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php(116):
Pimple\\Container->offsetGet('OC\\\\TempManager')\n#4
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/ServerContainer.php(132):
OC\\AppFramework\\Utility\\SimpleContainer->query('OC\\\\TempManager')\n#5
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php(164):
OC\\ServerContainer->query('OC\\\\TempManager')\n#6
\/snap\/nextcloud\/180831279\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php(109):
OC\\AppFramework\\Utility\\SimpleContainer->OC\\AppFramework\\Utility\\{closure}(***
sensitive parameters replaced ***)\n#7
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php(116):
Pimple\\Container->offsetGet('TempManager')\n#8
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/ServerContainer.php(132):
OC\\AppFramework\\Utility\\SimpleContainer->query('TempManager')\n#9
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/Server.php(1675):
OC\\ServerContainer->query('TempManager')\n#10
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/Server.php(1145):
OC\\Server->getTempManager()\n#11
\/snap\/nextcloud\/180831279\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php(113):
OC\\Server->OC\\{closure}(*** sensitive parameters replaced ***)\n#12
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php(116):
Pimple\\Container->offsetGet('OC\\\\Installer')\n#13
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/ServerContainer.php(132):
OC\\AppFramework\\Utility\\SimpleContainer->query('OC\\\\Installer')\n#14
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/legacy\/util.php(734):
OC\\ServerContainer->query('OC\\\\Installer')\n#15
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/base.php(675):
OC_Util::checkServer(Object(OC\\SystemConfig))\n#16
\/snap\/nextcloud\/180831279\/nextcloud\/lib\/base.php(1081):
OC::init()\n#17
\/snap\/nextcloud\/180831279\/nextcloud\/status.php(36):
require_once('\/snap\/nextcloud...')\n#18
{main}","File":"\/snap\/nextcloud\/180831279\/nextcloud\/lib\/private\/TempManager.php","Line":247}
CptJkeene commented 6 years ago

I replied this via email but figured I'd add it here, too:

Hi, thank you for responding. Yes, I am having an issue with my device. I bought a Syncloud OHC1 recently and set it up per the quickstart guide. I was not able to log into the device from my phone (I think a separate issue), but I was able to log in from my computer, install the nextcloud app, and create a nextcloud account. I had to update the device before it would let me connect an external hard drive and reformat for storage, but after that it seemed to be working ok. I then installed the windows desktop app, selected a folder to use for syncing, told it to automatically sync everything, and finished. After that I checked the sync folder on my desktop and nothing had synced. The nextcloud program showed the sync operations had been canceled and the server replied: service unavailable (see fig. 1 - 2).

When I log into Nextcloud on my browser (firefox) it shows the default files but the thumbnails are blank and you get various "server unavailable" errors when you try to open anything (see fig. 3 - 6). Meanwhile I'm able to log into the device and install apps from the syncloud interface. I tried using the 'Restart' option under the Shutdown button, and I tried restarting the device manually buy removing power and putting the power back. That made it impossible to log into nextcloud (which is when I clicked the Send Logs button because I was getting frustrated) until I logged back into the device and turned the external hard drive back on. Once I was logged back into nextcloud I found the same "server unavailable" issue as before.

In summary: I can log into the device and interact with the Syncloud interface, and I can log into my connected Nextcloud account via firefox, but my Nextcloud account is saying the server is unavailable and I cannot add or sync files via the desktop app or website.

I am new to this technology but very interested in having a home cloud. I was really hoping that this would be a simple plug and play operation but that is not the case. I've looked through the documentation but there are no good guides for getting set up from purchase to completion, especially for a beginner. It would not surprise me if the issue was a setting I ticked that I shouldn't have or some other minor thing that I'm not knowledgeable enough to find. If there is any information you need to help diagnose the issue I am at your disposal.

Jason fig 1 fig 2 fig 3 fig 4 fig 5 fig 6

cyberb commented 6 years ago

Thanks for reporting the problem, you did everything correct and no additional experience needed but simething went wrong on the device. Let me help you

From the logs i cannot see that you are using an external drive, do you have one? Can you activate it and send the logs right after that?

It should work also without external drive, but that is a second issue.

CptJkeene commented 6 years ago

Done. I've resent the logs with the external hard drive activated. It's a 4tb, but only 2tb are available. I assume that's just part of the design. Let me know if i can help with anything else.

cyberb commented 6 years ago

Can you sync files now?

Looks like yoir disk has only 1 partition with 2TB size on it and the rest is either not partitioned or another not supported partition. You can use gparted love cd on yoir desktop to examine it.

CptJkeene commented 6 years ago

It does not sync. I still get the "network failure" messages in Nextcloud on Firefox and "service unavailable" messages in Nextcloud on my desktop. I can still log into the device and change settings and stuff, but it won't let me access any data through Nextcloud.

CptJkeene commented 6 years ago

I'm not concerned about the device only allowing me to use 2tb, I can work on that later, but I am concerned about the network failure.

cyberb commented 6 years ago

Ok, can you send logs one more time?

cyberb commented 6 years ago

Just found this log, did you create user keene in nextcloud or changed its password? You shoild have devixe user which is created and shared across all the apps on a single device which is created during device activation (device user) Attempts to modify it may cause issues like this, you are free to create other users inside apps.

If that is what happened, I would suggest reinstalling nextcloid and see if that helps.

nextcloud.postgres[4102]: [3-1] ERROR:  duplicate key value violates unique constraint "oc_credentials_pkey"
Sep 28 07:13:11 odroid-xu3and4 nextcloud.postgres[4102]: [3-2] DETAIL:  Key ("user", identifier)=(keene, ****) already exists.
Sep 28 07:13:11 odroid-xu3and4 nextcloud.postgres[4102]: [3-3] STATEMENT:  INSERT INTO "oc_credentials" ("user", "identifier", "credentials") VALUES($1, $2, $3)
cyberb commented 6 years ago

Just found this log, did you create user keene in nextcloud or changed its password? You shoild have devixe user which is created and shared across all the apps on a single device which is created during device activation (device user) Attempts to modify it may cause issues like this, you are free to create other users inside apps.

If that is what happened, I would suggest reinstalling nextcloid and see if that helps.

nextcloud.postgres[4102]: [3-1] ERROR:  duplicate key value violates unique constraint "oc_credentials_pkey"
Sep 28 07:13:11 odroid-xu3and4 nextcloud.postgres[4102]: [3-2] DETAIL:  Key ("user", identifier)=(keene, ****) already exists.
Sep 28 07:13:11 odroid-xu3and4 nextcloud.postgres[4102]: [3-3] STATEMENT:  INSERT INTO "oc_credentials" ("user", "identifier", "credentials") VALUES($1, $2, $3)
CptJkeene commented 6 years ago

cyberb, you've done it. Honestly I should have uninstalled and reinstalled Nextcloud on the device along with the rest of my troubleshooting, but I really didn't even consider it. I feel dumb but the problem has been fixed. I still don't know how I managed to disconnect myself from the server through nextcloud. I didn't create any duplicate users or anything, but I was testing settings and rearranging things while initially trying to get my external drive to connect to the device. I will be more careful in the future.

You guys can close this one. Thanks for bearing with me.

cyberb commented 6 years ago

No problem, I understand it is far from ideal that it is kind of that easy to break the system. It is about balance between control and stability. I hope over time we will make it more stable at least it is easy start over after accidently breaking things.