nextcloud / vm

💻☁📦 The Nextcloud VM (virtual machine appliance), Home/SME Server and scripts for RPi (4). Community developed and maintained.
https://download.nextcloudvm.com
GNU General Public License v3.0
1.31k stars 657 forks source link

'It appears that something went wrong with the update.' on inititial login and setup #988

Closed xpseudonym closed 4 years ago

xpseudonym commented 4 years ago

Steps to reproduce

  1. virt-v2v -i ova Nextcloud-VM_www.hanssonit.se.ova -of qcow2 (reconfigured network)
  2. ssh ncadmin@nextcloud
  3. [sudo] password for ncadmin:

Expected behaviour

setup script runs successfuly

Actual behaviour

[sudo] password for ncadmin: Fetching all the variables from lib.sh... Testing if network is OK... Checking connection... curl: (7) Couldn't connect to server curl didn't produce a 200 status, is the site reachable? Setting correct interface... Checking connection... Server: 127.0.0.53 Address: 127.0.0.53#53

Non-authoritative answer: Name: github.com Address: 140.82.118.3

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 root@nextcloud:~# ping google.com PING google.com (172.217.20.110) 56(84) bytes of data. 64 bytes from fra02s28-in-f14.1e100.net (172.217.20.110): icmp_seq=1 ttl=51 time=18.1 ms ^C --- google.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 15.834/16.758/18.180/1.025 ms root@nextcloud:~#

Server configuration

Linux nextcloud 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Nextcloud server version: (see your admin page) Sorry, can't access web server (admin page)

Server OS (Ubuntu server is default) Linux nextcloud 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

How did you install the VM? (Scripted install from master OR Released version) virt-v2v -i ova Nextcloud-VM_www.hanssonit.se.ova -of qcow2

Network

Do you use DHCP? Yes

Is port 80 and/or 443 open? Yes, VM is on 192.168.0.22 http://192.168.0.22/ replies 'Apache2 Ubuntu Default Page' http://192.168.0.22/nextcloud replies: 'Not Found The requested URL was not found on this server.'

Logs / Screenshots

Log file (/mnt/ncdata/nextcloud.log)

less /mnt/ncdata/nextcloud.log

/mnt/ncdata/nextcloud.log: No such file or directory

Insert your nextcloud.log file here

less /mnt/ncdata/nextcloud.log

/mnt/ncdata/nextcloud.log: No such file or directory

Installation log (command output)

$ virsh dumpxml Nextcloud
<domain type='kvm' id='4'>
  <name>Nextcloud</name>
  <uuid>9bc9bfa8-b425-4657-82ac-8d94e126e5a5</uuid>
  <description>VM_www.hanssonit.se</description>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://ubuntu.com/ubuntu/18.04"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='volume' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source pool='default' volume='Nextcloud_VM_www.hanssonit.se-sda'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='volume' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source pool='default' volume='Nextcloud_VM_www.hanssonit.se-sdb'/>
      <backingStore/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:0d:a3:9a'/>
      <source bridge='nm-bridge1'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/3'>
      <source path='/dev/pts/3'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5901' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </rng>
    <panic model='isa'>
      <address type='isa' iobase='0x505'/>
    </panic>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c985,c1009</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c985,c1009</imagelabel>
  </seclabel>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>

Screenshoots

enoch85 commented 4 years ago

The second drive isn't mounted correctly, that's why .ocdata is missing.

xpseudonym commented 4 years ago

So, where should Nextcloud_VM_www.hanssonit.se-sdb go - which I assume is vdb?

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system>                  <mount point>   <type>  <options>         <dump>  <pass>
/dev/mapper/nextcloud--vg-root   /               ext4    errors=remount-ro 0       1
/dev/mapper/nextcloud--vg-swap_1 none            swap    sw                0       0

:/dev/mapper# ls -l
total 0
crw------- 1 root root 10, 236 Nov 24 01:48 control
lrwxrwxrwx 1 root root       7 Nov 24 01:48 nextcloud--vg-root -> ../dm-0
lrwxrwxrwx 1 root root       7 Nov 24 01:48 nextcloud--vg-swap_1 -> ../dm-1
:/dev/mapper# cd ../
:/dev# ls -l dm*
brw-rw---- 1 root disk 253, 0 Nov 24 01:48 dm-0
brw-rw---- 1 root disk 253, 1 Nov 24 01:48 dm-1
:/dev# ls -l vd*
brw-rw---- 1 root disk 252,  0 Nov 24 01:48 vda
brw-rw---- 1 root disk 252,  1 Nov 24 01:48 vda1
brw-rw---- 1 root disk 252, 16 Nov 24 01:48 vdb
brw-rw---- 1 root disk 252, 17 Nov 24 01:48 vdb1
brw-rw---- 1 root disk 252, 25 Nov 24 01:48 vdb9
:/dev#
xpseudonym commented 4 years ago

hmm, I think by .ocdata... you mean ncdata? And, /dev/disk/by-label/ncdata does, indeed, point to vdb - vdb1. Which I assume needs mounting here: /mnt/ncdata? What's on vdb9?

enoch85 commented 4 years ago

Please post the output of df -h. and ls -l /mnt/ncdata

xpseudonym commented 4 years ago

Oh, I see, .ocdata should be here /mnt/ncdata/.ocdata zpool import -fR / ncdata Put's it there How do I keep it there?

xpseudonym commented 4 years ago

Oops, missed that

# df -h
Filesystem                      Size  Used Avail Use% Mounted on
udev                            967M     0  967M   0% /dev
tmpfs                           200M  1.1M  199M   1% /run
/dev/mapper/nextcloud--vg-root   39G  3.2G   33G   9% /
tmpfs                           997M  8.0K  997M   1% /dev/shm
tmpfs                           5.0M     0  5.0M   0% /run/lock
tmpfs                           997M     0  997M   0% /sys/fs/cgroup
tmpfs                           200M     0  200M   0% /run/user/1000
ncdata                           39G   14M   39G   1% /mnt/ncdata
# ls -l /mnt/ncdata
total 2
drwxr-xr-x 5 www-data www-data 5 Nov  7 21:45 appdata_ocjykjmxhd1e
drwxr-xr-x 2 www-data www-data 3 Nov  7 21:44 files_external
-rw-r--r-- 1 www-data www-data 0 Nov  7 21:42 index.html
drwxr-xr-x 3 www-data www-data 3 Nov  7 21:42 ncadmin

But, that's after running: zpool import -fR / ncdata

enoch85 commented 4 years ago

But, that's after running: zpool import -fR / ncdata

OK, issue is solved then. :)

xpseudonym commented 4 years ago

Will it stick one boot to the next?

xpseudonym commented 4 years ago

Hmm, no, not persistent one boot to another:

[sudo] password for ncadmin: 
Fetching all the variables from lib.sh...
Testing if network is OK... 
Checking connection...
curl didn't produce a 200 status, is the site reachable?
Setting correct interface...
Checking connection...
Server:     127.0.0.53
Address:    127.0.0.53#53

Non-authoritative answer:
Name:   github.com
Address: 140.82.113.4

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
enoch85 commented 4 years ago

I can't reproduce this error and I do several installations every day on different servers around the world so there's nothing wrong in the scripts.

Please ask for help in the forum or get hands on support according to the "Support" label.

Thanks!

ghost commented 4 years ago

Because you are using a different vm system (virsh) to mount the zpool the systems uuid has changed, zpool won't automatically mount the zpool because it thinks it belongs to a different system. Running the following commands fixed it for me. (I'm using bhyve on FreeBSD).

sudo zpool import ncdata
sudo reboot

The -R option for zpool import will only temporarily import the pool.

enoch85 commented 4 years ago

(I'm using bhyve on FreeBSD).

@fyfe That makes sense, and is expected as well.

You can read more about currently supported systems here.

xpseudonym commented 4 years ago

@fyfe from my (limited) reading, the -R option seems to over-ride a cachefile, from the man: 'Set‐ ting altroot defaults to using cachefile=none'; 'Sets the "cachefile" property to "none"' I found this here: https://www.linuxtopia.org/online_books/opensolaris_2008/ZFSADMIN/html/gbscy.html#gftgp This release provides the cachefile property, which controls where pool configuration information is cached. All pools in the cache are automatically imported when the system boots.

I can confirm the fix form me - gnu/linux/fedora (how many slashes does a system need)

enoch85 commented 4 years ago

@xpseudonym It seems there may be room for improvement?

Do you fancy making a PR to correct future issues?

xpseudonym commented 4 years ago

Err, what's a PR...?

enoch85 commented 4 years ago

If you think something is wrong in the code, you can contribute by making a PR (Pull Request) and commit your improvements.

Thanks!

xpseudonym commented 4 years ago

Ah, that is very flattering, thank you. I'm sorry, de-bugging is one thing - I'm good at fixing cars, nuts and bolts I can hold in my hands, but retaining bits of code in my mind... It's just never worked.

enoch85 commented 4 years ago

Funny, I know nothing about cars. :)

xpseudonym commented 4 years ago

:o)

enoch85 commented 4 years ago

Related: https://github.com/nextcloud/vm/issues/1204

enoch85 commented 2 years ago

FYI there's a new guide online for installing on TrueNAS.

xpseudonym commented 2 years ago

Thank you for that - I've since discovered the benefits of containers... :)