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

Installer Broken #1004

Closed
ddanetidwell opened this issue Dec 28, 2019 · 16 comments
Closed

Installer Broken #1004

ddanetidwell opened this issue Dec 28, 2019 · 16 comments
Labels
Support Please visit https://help.nextcloud.com or https://shop.hanssonit.se/product-category/support/

Comments

@ddanetidwell
Copy link

Steps to reproduce

  1. Installer restarting
  2. SSH enter user/pass
  3. Broke.

Expected behaviour

The rest of the installation should complete

Actual behaviour

Fetching all the variables from lib.sh...
Testing if network is OK...
Checking connection...
Online!
Testing if network is OK...
Checking connection...
Online!
/dev/fd/63: line 789: [: : integer expression expected
/dev/fd/63: line 825: [: : integer expression expected
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/17/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:
#0 /var/www/nextcloud/console.php(96): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ -V failed

Server configuration

UNK

Server OS (Ubuntu server is default)

Scripted install from master

Network

No

Yes

Logs / Screenshots

Log file (/var/log/nextcloud/nextcloud.log)

Insert your nextcloud.log file here

Installation log (command output)

Insert the CLI output here

Screenshoots

@enoch85 enoch85 added the Support Please visit https://help.nextcloud.com or https://shop.hanssonit.se/product-category/support/ label Dec 28, 2019
@enoch85
Copy link
Member

enoch85 commented Dec 28, 2019

You need to mount both drives correctly, or choose 1 drive during the initial setup if you used the scripts.

@enoch85 enoch85 closed this as completed Dec 28, 2019
@ddanetidwell
Copy link
Author

ddanetidwell commented Dec 29, 2019

I'd appreciate it if you didn't close the issue with a vague "You didn't do something right".

If there are two steps to the instructions, the first of which completes successfully with no errors and the second is broken with the above errors, then there is an issue with the installer, not with how I mounted the drive.

Nextcloud formatted the drive in the first process, and as you can see below, it is mounted for the second process (sdc).

findmnt
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda1 ext4 rw,relatime,discard
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755
│ │ ├─/sys/fs/cgroup/unified cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate
│ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd
│ │ ├─/sys/fs/cgroup/rdma cgroup cgroup rw,nosuid,nodev,noexec,relatime,rdma
│ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb
│ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset
│ │ ├─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids
│ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
│ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
│ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
│ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event
│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
│ │ ├─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
│ │ └─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
│ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/debug debugfs debugfs rw,relatime
│ ├─/sys/kernel/config configfs configfs rw,relatime
│ └─/sys/fs/fuse/connections fusectl fusectl rw,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=23802
├─/dev udev devtmpfs rw,nosuid,relatime,size=4056632k,nr_inodes=1014158,mode=755
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/mqueue mqueue mqueue rw,relatime
│ └─/dev/hugepages hugetlbfs hugetlbfs rw,relatime,pagesize=2M
├─/run tmpfs tmpfs rw,nosuid,noexec,relatime,size=814440k,mode=755
│ ├─/run/lock tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k
│ └─/run/user/1001 tmpfs tmpfs rw,nosuid,nodev,relatime,size=814440k,mode=700,uid=1001,gid=1001
├─/mnt/ncdata ncdata zfs rw,noatime,xattr,noacl
├─/boot/efi /dev/sda15 vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro,discard
└─/mnt /dev/sdb1 ext4 rw,relatime

@enoch85 enoch85 reopened this Dec 29, 2019
@enoch85
Copy link
Member

enoch85 commented Dec 29, 2019

OK, I'll make an installation when have time just to test. But I'm 99.9% sure it's working since nothing changed since release and I do 10 installations each time.

@enoch85
Copy link
Member

enoch85 commented Dec 29, 2019

@thedanetidwell OK, so I just tested a fresh install on VMware ESXi 6.5, and I don't experience any of the issues you are describing.

Which hypervisor are you running? How did you mount the disks?

@enoch85
Copy link
Member

enoch85 commented Jan 2, 2020

Tested today again and everything works.

@enoch85 enoch85 closed this as completed Jan 2, 2020
@galusha1
Copy link

I am getting the exact same errors as @thedanetidwell.
Environment is Azure VM using Ubuntu 18.04LTS.
During disk setup, I manually selected SDC where it then formatted and mounted the drive with no errors. After Nextcloud install and reboot, error is as posted and findmnt shows the same results. I have re-created the vm 4 to 5 times in the past 24 hours with the same result over and over. Df is not showing the drive mounted however, but zpool list shows the ncdata online. I need this up and working as soon as possible so any assistance would be greatly appreciated.
Thank You.

|-/mnt/ncdata ncdata zfs rw,noatime,xattr,noacl

@galusha1
Copy link

Sorry, output is a little different, but stops at the same point.
Output:
Fetching all the variables from lib.sh...
Testing if network is OK...
Checking connection...
Online!
Testing if network is OK...
Checking connection...
Online!
/dev/fd/63: line 946: [: : integer expression expected
/dev/fd/63: line 986: [: : integer expression expected
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/18/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:167
Stack trace:
#0 /var/www/nextcloud/console.php(98): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ -V failed
parse error: Invalid numeric literal at line 1, column 5
The notifications app isn't enabled - unable to send notifications

@galusha1
Copy link

I went in and used chown, chgrp, and chmod to set permissions of /var/www/nextcloud and /mnt/ncdata to match a working servers permissions and then re-ran the sudo -u sudo bash /var/scripts/nextcloud-startup-script.sh

Things have continued on as normal now.

@enoch85
Copy link
Member

enoch85 commented Mar 26, 2020

Permissions are set before Nextcloud is installed:

https://github.com/nextcloud/vm/blob/master/nextcloud_install_production.sh#L370-L372

@galusha1
Copy link

Is there a reason that line in the script wouldn't have applied permissions correctly or that after the reboot those permissions were change? Because after the reboot the permissions for all of those folders and files were all set to root for owner and group with www-data having not access until after I changed it manually and then re-ran the setup script.

@enoch85
Copy link
Member

enoch85 commented Mar 26, 2020

Maybe it's an Azure thing, I don't know actually. It works on a plain Ubuntu 18.04 machine on VMware. Making a new release right now, and so far 3 installations were OK.

There are no bugs in the script, since it applies correctly, and permissions are correct.

Try it for yourself and see. Fire up a plain Ubuntu Server 18.04, run the script and see the result.

@enoch85
Copy link
Member

enoch85 commented Mar 26, 2020

@galusha1
Copy link

That is the process I have been following. I actually have to reload now again because the zfs disk didn't mount correctly, the data share filled up, and then when fixing the issue I accidentally deleted part of the content of /mnt/ncdata and I am not sure how to repair that. So reloading again, with a brand new 18.04lts with the script and will let you know how it goes.

@galusha1
Copy link

Ok, brand new server install.

Before script reboot:
/dev/sdb1 ext4 7.9G 36M 7.4G 1% /mnt
lxcfs fuse.lxcfs 0 0 0 - /var/lib/lxcfs
tmpfs tmpfs 391M 0 391M 0% /run/user/1000
binfmt_misc binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
ncdata zfs 493G 0 493G 0% /mnt/ncdata

After Script Reboot:
configfs configfs 0 0 0 - /sys/kernel/config
/dev/sda15 vfat 105M 3.6M 101M 4% /boot/efi
ncdata - - - - - /mnt/ncdata
/dev/sdb1 ext4 7.9G 36M 7.4G 1% /mnt
tmpfs tmpfs 393M 0 393M 0% /run/user/1000

Script fails after reboot stating:
Your current version are still not compatible with the version required to run this script.
To upgrade between major versions, please check this out:

After closing prompt, this is what is in the terminal:
Fetching all the variables from lib.sh...
Testing if network is OK...
Checking connection...
Online!
Testing if network is OK...
Checking connection...
Online!
/dev/fd/63: line 946: [: : integer expression expected
/dev/fd/63: line 986: [: : integer expression expected
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/18/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:167
Stack trace:
#0 /var/www/nextcloud/console.php(98): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ -V failed
parse error: Invalid numeric literal at line 1, column 5
The notifications app isn't enabled - unable to send notifications

Folder permissions:
drwxr-xr-x 4 root root 4096 Mar 27 01:13 .
drwxr-xr-x 23 root root 4096 Mar 27 01:27 ..
-r--r--r-- 1 root root 639 Mar 27 01:09 DATALOSS_WARNING_README.txt
drwx------ 2 root root 16384 Mar 27 01:08 lost+found
drwxr-xr-x 2 root root 4096 Mar 27 01:13 ncdata

drwxr-xr-x 4 root root 4096 Mar 27 01:16 .
drwxr-xr-x 16 root root 4096 Mar 27 01:21 ..
drwxr-xr-x 2 root root 4096 Mar 27 01:15 html
drwxr-x--- 14 root www-data 4096 Mar 27 01:16 nextcloud

@galusha1
Copy link

I think that untimely what it is, zfs isn't auto mounting correctly therefor the .ocdata file is missing and the script is then failing thinking the version is incorrect.

When I run sudo -u www-data php /var/www/nextcloud/occ -V after everything is fixed with zfs and the .ocdata file is present with the correct permissions it completes and returns the Nextcloud version. Before that the command fails with the error above.

I hopefully will not be reloading, but hopefully this helps someone else.

@enoch85
Copy link
Member

enoch85 commented Mar 27, 2020

I think that untimely what it is, zfs isn't auto mounting correctly therefor the .ocdata file is missing and the script is then failing thinking the version is incorrect.

Yes, that seems about right.

Still, very strange issue - that only seems to be on very certain servers, this time Azure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Please visit https://help.nextcloud.com or https://shop.hanssonit.se/product-category/support/
Projects
None yet
Development

No branches or pull requests

3 participants