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

Caddy Error When Enabling HTTPS #41

Closed
AlexanderKrall opened this issue Oct 9, 2019 · 8 comments
Closed

Caddy Error When Enabling HTTPS #41

AlexanderKrall opened this issue Oct 9, 2019 · 8 comments

Comments

@AlexanderKrall
Copy link

AlexanderKrall commented Oct 9, 2019

To whom it may concern:

I followed the installation instructions listed for the Raspberry Pi version of Rocket Chat. The software installs properly. However, I am having an issue enabling HTTPS using caddy. The instructions state that I have to run the following commands:

  1. sudo snap set rocketchat-server caddy-url=https://<your-domain-name>
  2. sudo snap set rocketchat-server caddy=enable
  3. sudo snap set rocketchat-server https=enable
  4. sudo rocketchat-server.initcaddy

When running the third command, I get this error:
error: cannot perform the following tasks:
- Run configure hook of "rocketchat-server" snap (run hook "configure":
-----
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
dig: error while loading shared libraries: libdns.so.162: cannot open shared object file: No such file or directory
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Error: Can't resolve DNS query for <your-domain-name>, check your DNS configuration, disabling https . . .
-----)

Note:

  • Wherever the code says "your-domain-name" I did actually put my real domain name in.
  • I am using a Raspberry Pi Model 4, 4GB with a fresh installation of the September 26th version of Raspbian Buster Lite.
  • I am using GoDaddy with an A record to link my domain name to my router's public IP.
  • Port 80 and Port 443 are open on my router. I have enabled port forwarding.
  • If I open port 3000 on my router, I am able to access Rocket from :3000. However, this does not enable https, which is what I would like.
  • My pi does have a static IP set up for it

Any help would be much appreciated!

@AlexanderKrall
Copy link
Author

It seems like the main issue is that the rocketchat software install on snap points to the wrong location for dig. Is there anyway I can fix this so that it points to the right location?

@ignasurba
Copy link

Found myself in the same boat. This worked:

sudo nano /etc/ld.so.preload and comment out the line:
/usr/lib/arm-linux-gnueabihf/libarmmem.so

but now:
dig: error while loading shared libraries: libdns.so.162: cannot open shared object file: No such file or directory

@drasbeck
Copy link

drasbeck commented Oct 30, 2019

I am experiencing the same issue as OP.

Environment: Rpi4 4GB running Linux 4.19.80-v8-james #15 SMP PREEMPT Sun Oct 27 21:58:14 PDT 2019 aarch64 GNU/Linux from here

Installation method: snap --edge channel, so server version 1.3.2

@Ed-80
Copy link

Ed-80 commented Nov 6, 2019

I ran into a similar problem. I followed the instructions how to set up caddy manually and that seemed to reslove it for me. I was then experiencing the pi would drop the wired ethernet connection after a few hours. The work around I did for this was manually setup a static IP address on the pi.
I hope this helps.
-Ed

@Joonas-M
Copy link

I had the same problem with the Raspbian OS (I have RaspberryPi 4 with 4GB RAM). I didn't really find a proper workaround for it but there are couple of problems. The snap gives only version one from rocketchat-server and not the newest one (version 3). Also, the OS does not have dnsutils installed so dig cannot be used for dns lookups.

Because Raspbian failed, I started to try Ubuntu images provided by the Imager software. Unfortunately I first installed Ubuntu 20.04 as that does not work either. The Mongo db does not start up. That is probably because it is not supported as stated here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

I finally installed Ubuntu core 18 64 bit version. Installing and using that image is a bit of a pain because you need to create an Ubuntu SSO account and copy your SSH key there (as stated here https://ubuntu.com/download/raspberry-pi-core). After that, you cannot just use the OS after installing it on the Pi. You need to access your rbp from another computer using SSH. From there, installing the rocketchat-server snap version 3 works fine.

However, to enable HTTPS using caddy, you need to follow the manual configuration steps set here https://rocket.chat/docs/installation/manual-installation/ubuntu/snaps/autossl/#enabling-caddy Basically the first option set forth on that page does not work because sudo snap set rocketchat-server https=enable fails. What I did was more like

sudo snap set rocketchat-server caddy-url=https://<your-domain-name>
sudo snap set rocketchat-server caddy=enable
sudo snap run rocketchat-server.initcaddy

edit /var/snap/rocketchat-server/current/Caddyfile to look like

<your-domain-name> {
  proxy / localhost:3000 {
    websocket
    transparent
  }
}

as stated in the documentation. Then run

sudo systemctl restart snap.rocketchat-server.rocketchat-server.service
sudo systemctl restart snap.rocketchat-server.rocketchat-caddy.service

I don't remember if those were the exact steps to get it work. Hopefully this helps someone!

@Sing-Li
Copy link
Member

Sing-Li commented Apr 26, 2020

Because Raspbian failed, I started to try Ubuntu images provided by the Imager software. Unfortunately I first installed Ubuntu 20.04 as that does not work either. The Mongo db does not start up. That is probably because it is not supported as stated here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

@Joonas-M did you try the 64bit version of Unbuntu 20.04 ? It should actually work fine.

image

@Joonas-M
Copy link

Joonas-M commented Apr 26, 2020

Hi, I'll leave a comment here for others to read as well, as we discussed about this with Sing-Li at https://open.rocket.chat/channel/raspberrypi So the issue was not with the Ubuntu 20.04 version but with the user :) Mongo was complaining "start request repeated too quickly", which could have been fixed if the following was done

Stopping both services first. THEN Restarting in this order -> first mongo, then watch logs until it stablize THEN RC

as stated by Li.

So, if you want to try Ubuntu 20.04, remember those steps as well.

@Sing-Li
Copy link
Member

Sing-Li commented May 11, 2020

I finally got a chance to try 20.04lts with the snap (containing latest arm64 mongodb). And there is some fundamental compatibility problem.

MongoDB's official support literature currently do not cover 20.04lts.

I have updated our README to reflect this.

All production servers should use Arm64 Ubuntu 18.04lts in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants