Nextcloud Snap users, please list the issues you're facing

snap

#83

Great investigation! That sounds broken indeed. However, I’m afraid I’m not familiar enough with Nextcloud to know the purpose of that table, nor the ramifications of modifying it by hand. Note that you can get into the database via the included client: sudo nextcloud.mysql-client.

This seems to be a Nextcloud issue that’s not specific to the snap. I suggest opening a new topic with this same information to get more eyes from core Nextcloud folks.


#84

Thanks Kyle, I did so: https://github.com/nextcloud/server/issues/7312


#85

The only issue I’ve faced is the inability to put nextcloud data on a separate drive. But that could be classified alternatively as a feature request.

Just wanted to say big thanks for making nextcloud snap, setting up literally was four steps:

  1. Installed Ubuntu on an inexpensive new server (dell poweredge t30).
  2. Installed Nextcloud: sudo snap install nextcloud
  3. Configured Nextcloud at http://serveripaddress
  4. Set up free cert via Let’s Encrypt: sudo nextcloud.enable-https lets-encrypt

#86

@sunrisen thank you for the kind words! As for storing your data on an external drive, that’s already supported: Please see the README for more details.


#87

I only have had one issue so far, and it probably lies at my feet (lack of experience or completely missing existing documentation), but:

  • (A) There isn’t a way to edit the apache config file for virtual hosts (so that I could have, say, blog.mydomain.com et.al alongside NC) - at least insofar as the snap package goes. Most support pages I found talk about the manual installation folders (/var/www/html/nextcloud, etc) instead of /snap/nextcloud/.

  • (B) and could not for the life of me find any documentation or previous support issues that address virtual hosts/subdomains with the snap package. I’m assuming from your blog post here that opening up the guts to be edited is something you aren’t keen to do…so I’m at a loss if this is even possible.

Aside from that, I love how absolutely easy it was to setup Nextcloud with this snap; even with limited knowledge of linux, it was a breeze to set up at mydomain.com and get the certs from lets-encrypt. Not much has been this easy!


#88

Hey there @thegreyfawkes, thanks for the questions. They’re really the same question, heh. You’re right, the Apache contained within the snap is not meant to be used by anything other than Nextcloud. Basically: this is the Nextcloud snap, not the Apache snap. If we had to support all the numerous uses of Nextcloud as well as the numerous uses of Apache we’d die in a support fire! Not to mention, if we opened the Apache config, we’d immediately be married to Apache for all time, precluding the ability to ever move to anything else (e.g. nginx).

Think of the snap as a standalone thing. You shouldn’t need to care that it uses Apache. If you want to run your own Apache instance, with other vhosts, then change the port on which Nextcloud is listening and proxy to it from your Apache.


#89

Thanks @kyrofa, I’ll give that a shot. I appreciate the guidance!


#90

New Domain => New certificate => How to get it active at Nextcloud snap

With registering to a new domain I retriggered the nextcloud.enable-https script for obtaining a new certificate. The script did run successfully.

When using the new domain to access my nextcloud I receive the message that the certificate does not fit to the new domain. A quick check revealed that still the old certificate for the previous domain was returned.

Question is now how can I de-activate the old certificate and take the new one into use?

I did already:

  • Use the disable-https script and enable-https script consecutively.
  • Stopped and restarted the nextcloud snap
  • Checked at var/snap/nextcloud/current/certs folder. The new certificate seems to be present even though not actively used.

#91

I just added a second domain to my cert a little while ago, and did exactly that-- ran nextcloud.enable-https lets-encrypt again, this time with both domains. That script restarts Apache, which picked up the new cert. Have you tried restarting Apache yourself?

$ sudo systemctl restart snap.nextcloud.apache.service

If that doesn’t work, and you’ve verified that the new certs are correct and the old certs aren’t around, I’m not sure what’s going on there, but we can take the nuclear option.

First of all, disable HTTPS (this just removes a symlink, it doesn’t remove any certs):

$ sudo nextcloud.disable-https

Then blow away any certs that are there (this includes self-signed certs, Let’s Encrypt certs, everything). Make sure you get this command right, you don’t want to delete anything else in the current/ dir:

$ sudo rm -rf /var/snap/nextcloud/current/certs

Then pretend you’re enabling HTTPS for the first time:

$ sudo nextcloud.enable-https lets-encrypt

#92

Actually, re-reading your post, it sounds like you’re not adding a new domain (thus having multiple), but replacing one. Correct? In that case, do you have multiple directories in /var/snap/nextcloud/current/certs/certbot/live? If so, that’s the issue. The fix is really the same, but please let me know if this is the case, because that’s an experience we could improve.


#93

Right, I am replacing the domain.

There are two directories at /var/snap/nextcloud/current/certs/certbot/config/live/ . Each named according to my domains, the old one and the new one.

Have you tried restarting Apache yourself?

The “enable-https” script was outputting that it restarts apache. In addition I did stop and restart the whole snap. Anyway I restarted the apache server again with the command provided by you. Situation did not change.

Was going now with the “nuclear option”, laying waste to the certificates and creating a new one.
Worked fine :smiley:.

Thanks a lot for your feedback.

P.S.: FYI, binding a new domain to my nextcloud is due to a DDNS Service provided for free by a manufacturer of internet-routers (AVM). This particular DDNS Service is actually bound to the internet-router devices. With replacing my device and registering it for the DDNS Service, a new domain was assigned.


#94

I have installed the snap in Raspbian 2017-11-29-raspbian-stretch-liteRaspbian 2017-11-29-raspbian-stretch-lite.
I needed to change the port. This I did and I can access it on the local network. However I am unable to access via my domain name. I need to be able to add it to trusted domains but the command line utility: nextcloud.occ is not recognised. So I navigated to the nextcloud snap bin directory and ran as: sudo ./occ config:system:get trusted_domains
This returned: ./occ: 3: .: Can’t open /utilities/mysql-utilities
I also want to enable https.

Further to this I am running raspbian now because the Ubuntu 16.04 LTS wouldn’t even install the snap - I put that down to the kernel. After spending a lot of time on this I abandoned it and tried Raspbian where I have had much more success.


#95

You can’t run stuff from within the snap manually. You need to run things from /snap/bin, which should be on the PATH. You may need to logout/login in order to get it on there, though. I haven’t tried running snaps from Raspbian, but they should definitely work on Ubuntu 16.04. Not sure what issues you ran into there, unless the kernel you were using was non-standard (in which case it’s not really Ubuntu).


#96

As you can see I have already tried to run the command from the bin directory, as you stated, but it threw up an error. Also the button, which appears on the page, that is presented when there is no connection on the remote url is badly formed - i.e. I think there is a bug there. Part of the url is this:
index.php/settings/admin?trustDomain=

I can’t see that being correct. The query string should follow ‘index.php’ if anything. I tried modifying it to no avail. So now I am in a situation where Nextcloud runs but it is useless in practice because I can’t run it remotely.
The snap commands appear to work - for example i was able to change the port, but those that are supposed to run directly via sudo don’t woprk - even from within the bin directory as ./ or with the path included in the command.

The Ubuntu 16.04 was one I installed from a Pi image a while ago and is fully updated, it is my server. The snap, as I say, didn’t even finish installation on Ubuntu. So, all in all a failure for snaps as far as I am concerned. I tried a standard install on Ubuntu too, I got problems there too :frowning_face:


#97

I’m afraid that’s not what I stated. In fact, you’re doing exactly what I told you not to do. Please read my comment again.

Those commands are in /snap/bin, as I said. Not “the bin of the snap,” but literally the path /snap/bin.

Classic Ubuntu doesn’t have a Pi image, so it sounds like you’re running something non-standard. Can’t really help you there. Snaps need some specific kernel features.


#98

I am guessing the issues I am facing is mostly about the lack of documentation. Installation was pretty easy. However figuring out the rest has been a big waste of time.

The out-of-snap product functions greatly but it is not sufficient for practical purposes even for a skill-less admin like me. In addition to the snap-version, I would like to use a secure connection, figure out where my data is (in order to set up a back-up system in case of failures) and configure apache (in order to set up a subdomain instead of an ip). The nextcloud documentation regarding these configurations assumes manual installation.

After hours of search I found how to convert those instructions to snap-installation instructions here: https://github.com/nextcloud/nextcloud-snap

It is not convenient for technically less skillful fellows like myself.


#99

If you need help with a snap, it’s always best to see what snap info says about it:

$ snap info nextcloud
<snip>
contact:   https://github.com/nextcloud/nextcloud-snap
<snip>

That’s the only documentation over which we have control. If the Nextcloud folks are interested, we can certainly add some information about how to use the snap to the docs.


#100

I’m new to Linux, new to VPS, and new to NC. If there is a more appropriate thread for me to post in please let me know.

I followed this:

to install NC on my DO droplet and it’s working just fine. Amazingly simple!

I’ve read the thread from the top and it seems that if I want to host a website on the same VPS, my best bet might be to uninstall the snap package and proceed with a LAMP stack followed by a manual install of NC. Is this correct?

P.S. I’ll take the opportunity of my first post to praise the great efforts the staff has put into ensuring decorum here.


#101

Oh no, you can set it up however you like! The only limitation you have is that you can’t modify the Apache bundled with the snap. That’s okay, you can install your own Apache and change the default ports of the snap, and setup a vhost that proxies to the snap (and another vhost for your other website, etc.). The setup I use personally is to have every website (including the snap) in its own lxd container, and have another lxd container running haproxy to get traffic into the cluster of containers.


#102

Thanks! I get the basic idea of what you are recommending. I’m a bit foggy on the particulars but I’ll read up an learn some new skills. Just one consideration, will running an additional Apache and the lxds use more system resources than a manual install of LAMP + NC?