Startup script should run but does not.
Here is the output to the console.
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.
Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/14/go.php?to=admin-dir_permissions.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
sudo -u www-data php /var/www/nextcloud/occ -V failed
Nextcloud 14 OVA VM downloaded on 10-19-2018 running under XCP-NG (Xen hypervisor) 7.5 with default configuration, default RAM and CPU, 1 NIC.
How did you install the VM? (Scripted install Released version)
Do you use DHCP? DHCP used
Is port 80 and/or 443 open? all ports open and connected out but script won't even run.
Run this: sudo touch /mnt/ncdata/.ocdata
Does that fix the error?
Also, what's the output of: sudo fdisk -l?
Did the touch command on that file, then ran ls -a on the directory and it shows 0kb on the .ocdata file, owner and group is root, no write or execute on the file. Would those permissions need to be changed to add write and execute perhaps?
Anyway, here is the output from the fdisk -l. https://imgur.com/a/WrO3fre I see both 40GB vdisks. I double checked my storage from when the ova was imported into my xcp-ng host. disk0 path is /dev/xvda disk1 is /dev/xvdb both 40GB, local storage on the host. Hope that helps! Thanks in advance!
AAH, this is on KVM?
It used to be on KVM running on a Proxmox host back when I had this functioning with Nextcloud 13. A few months ago my RAID controller died, so I had to rebuild the server again (it's all the same hardware as it was before running Proxmox with KVM, just a new hypervisor now). I just now am getting around to rebuilding this since I have the time to do it, and I ended up installing XCP-NG as a hypervisor instead since I didn't care for the new version of Proxmox. XCP-NG in case you aren't familiar with it, is basically Citrix XenServer 7.5 but forked and entirely opensource. So it is running Xen hypervisor actually. I ran the import wizard to get the OVA file into a new VM, and it imported just fine and the OS is booting and I can login just fine at least I got that far!
The VM itself is fully tested with KVM, Hyper-V, or VMware (preferred). So what you are trying to do is not supported I guess.
Please help me/us test if it works if you install it directly with the scripts, does that work? You can check the process here: https://github.com/nextcloud/vm#build-your-own-vm-or-install-on-a-vps
Thanks!
I'll give that a try running the script from a manual build later this weekend when I get a chance and see what happens!
I would think, at least in theory, that XenServer/XCP-NG would be at least very similar to how VMWare handles virtualization as they are both "type 1" baremetal hypervisors. XenServer just isn't quite as popular as the other virtualization solutions. Luckily this is just a home server for my own use, and I like learning new things as I go, so I am always open to being a test subject.
I wonder if there is just something strange with how the import took to the virtual disks when it grabbed the ova file. I might try this ova image in VMWare workstation and see if I can get it to run, then from there perhaps I'll export the VM and then re-import it. Either way, I'll see if I can play with it a bit more and report back on my findings.
and I like learning new things as I go, so I am always open to being a test subject.
Sounds a lot like me a few years ago, and still going strong. :)
I wonder if there is just something strange with how the import took to the virtual disks when it grabbed the ova file.
Probably, because I can't reproduce it.
'll see if I can play with it a bit more and report back on my findings.
Please do! Thanks!
I am experiencing an issue on running the VM specifically when the script tries to run.Below is the copy of the error i am getting.
/dev/fd/63: line 695: [: : integer expression expected
/dev/fd/63: line 731: [: : integer expression expected
Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/14/go.php?to=admin-dir_permissions.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
sudo -u www-data php /var/www/nextcloud/occ -V failed
Hmm, I can't reproduce the errors so it's kind of hard to debug it.
@geofreybingachie Which Hypervisor do you use?
Hmm, I can't reproduce the errors so it's kind of hard to debug it.
@geofreybingachie Which Hypervisor do you use?
I am running on a pc and the system boots fine not a virtual environment.Let me know if we can have a private chat so that you can try and access the test pc to experience the challenge.
Update
I have managed to run the setup script after running the script that fixes the permissions.
I have managed to run the setup script after running the script that fixes the permissions.
OK, can you post the exact "steps to reproduce" please?
Hi All,
I may need to add something about this to the Read Me section as it keeps popping up from time to time in the issues.
The OVA image is only supported on VMware, HyperV and Virtualbox as they use the standard sda and sdb disk naming convention.
The additional hypervisors I added support for (DigitalOcean, Xen, XCP and KVM) use different disk naming conventions (xda, xvda, etc.) which need to be installed manually using the install script:
wget https://raw.githubusercontent.com/nextcloud/vm/master/nextcloud_install_production.sh
Thanks,
K
Closing as no one cares to provide information needed, and that this is probably run in an unsupported Hypervisor.
I have managed to run the setup script after running the script that fixes the permissions.
OK, can you post the exact "steps to reproduce" please?
I downloaded the image and copied it to a hard drive and then when i tried to boot all was well until that part where the first script is supposed to run.
At that point the below information would appear on the screen.I however managed to navigate to where the scripts are and used the scripts that resets permission and i managed to proceed with the setup without a hitch.
**/dev/fd/63: line 695: [: : integer expression expected
/dev/fd/63: line 731: [: : integer expression expected
Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/14/go.php?to=admin-dir_permissions.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
sudo -u www-data php /var/www/nextcloud/occ -V failed**
@geofreybingachie I ask you again:
Which Hypervisor do you use?
@zalonic If I run the nextcloud_install_production.sh manually, does this run through the exact same setup procedure as the pre-built VM I grabbed from the website? I.e. does it walk me through obtaining a valid cert, install, etc with all steps involved for getting a fully functional Nextcloud instance up and running, just downloading the script to whatever Ubuntu/Debian/etc VM I want to manually setup?
I'm going to try that today actually and see how it goes on my XCP-NG host. My second option would be to set it up in VMWare Workstation, then convert it to the proper format then import into XCP-NG, as I believe it will handle all the changes to make it work but I haven't tested it yet. Thanks!
EDIT: Script does run successfully under VMWare workstation for me, so you are definitely correct about the default disk naming under Xen being different from how VMWare names their disks. I totally forgot about that little nuance.
@lanmansa All test scenarios would be useful information actually. So please test and come back with that info.
does this run through the exact same setup procedure as the pre-built VM I grabbed from the website?
Yes
downloading the script to whatever Ubuntu/Debian/etc VM
Only Ubuntu Server 18.04 is supported, not Debian or anything else.
I setup a bare-bones fresh install of Ubuntu Server live ISO 18.04, using two virtual disks, which was nice doing this manually so I could choose the disk sizes I wanted and customize the setup. Once completed I ran updates and then downloaded the script and ran it. Everything worked just fine as expected on the XCP-NG/Xen VM! https://imgur.com/a/ko0Q65J
Now I'm at the point of trying to get my ports fowarded through PFSense properly, should be trivial to fix it now hopefully. Going to check if Ubuntu Server has any firewall enabled by default or not that might be blocking it from contacting port 80 to the outside.
I got the same issue today. The only way I’ve found is to run the script /var/scripts/setup_secure_permissions_nextcloud.sh first. This definitely solved the problem.
Most helpful comment
Hi All,
I may need to add something about this to the Read Me section as it keeps popping up from time to time in the issues.
The OVA image is only supported on VMware, HyperV and Virtualbox as they use the standard sda and sdb disk naming convention.
The additional hypervisors I added support for (DigitalOcean, Xen, XCP and KVM) use different disk naming conventions (xda, xvda, etc.) which need to be installed manually using the install script:
wget https://raw.githubusercontent.com/nextcloud/vm/master/nextcloud_install_production.shThanks,
K