Cells and FreeBSD - panic on install

Longtime Pydio user here (since V5 if my memory serves me right). I recently upgraded my FreeBSD server and decided to make a fresh Pydio installation. And why not go with Cells from the beginning?
Anyway, I got Go set up and working and think I solved most of the dependencies all right, however, when installing Pydio via ./cells install I sooner or later run into the following problem:

> Welcome to Pydio Cells Home Edition installation
> Pydio Cells Home Edition will be configured to run on this machine. Make sure to prepare the following data
>  - IPs and ports for binding the webserver to outside world
>  - MySQL 5.6+ (or MariaDB equivalent) server access
> Pick your installation mode when you are ready.
> 
> ✔ Browser-based (requires a browser access)
> ✔ [URL]
> ✔ Disable SSL (not recommended)
> ✔ External Url, used to access application from outside world (it can differ from internal url if you are behind a pr✔ External Url, used to access application from outside world (it can differ from internal url if you are behind a proxy or inside a private network): [URL]
> panic: runtime error: invalid memory address or nil pointer dereference
> [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xb7f358]
> 
> goroutine 1 [running]:
github.com/pydio/cells/vendor/github.com/zalando/go-keyring.Get(0x2ce9bb9, 0x13, 0x2cdaa74, 0xe, 0xc0007377c0, 0x203000, 0x203000, 0x2ccb0b1)
    /root/.gopkg/src/github.com/pydio/cells/vendor/github.com/zalando/go-keyring/keyring.go:32 +0x28
github.com/pydio/cells/common/crypto.GetKeyringPassword(0x2ce9bb9, 0x13, 0x2cdaa74, 0xe, 0x0, 0x98, 0x2b1b180, 0xc000cea810, 0x100000000000000, 0x0)
    /root/.gopkg/src/github.com/pydio/cells/common/crypto/keyring.go:33 +0x56
github.com/pydio/cells/common/config/vault.(*VaultSource).initMasterPassword(0xc0007377c0)
    /root/.gopkg/src/github.com/pydio/cells/common/config/vault/source.go:152 +0xe8
github.com/pydio/cells/common/config/vault.NewVaultSource(0xc000ca6480, 0x2a, 0xc000ca64b0, 0x29, 0x0, 0x0, 0x0, 0x0, 0x414d6d)
    /root/.gopkg/src/github.com/pydio/cells/common/config/vault/source.go:51 +0x184
github.com/pydio/cells/common/config.Vault.func1()
    /root/.gopkg/src/github.com/pydio/cells/common/config/secrets.go:47 +0x374
sync.(*Once).Do(0x55847f0, 0x2e016c0)
    /usr/local/go/src/sync/once.go:44 +0xb3
github.com/pydio/cells/common/config.Vault(0xc000c96c60, 0x2709420)
    /root/.gopkg/src/github.com/pydio/cells/common/config/secrets.go:28 +0x39
github.com/pydio/cells/common/config.Set(0x2709420, 0xc000c8f320, 0xc000cb57e0, 0x2, 0x2)
    /root/.gopkg/src/github.com/pydio/cells/common/config/vars.go:150 +0x17d
github.com/pydio/cells/cmd.promptAndSaveInstallUrls(0xc000447110, 0x0, 0xc0005af770, 0x29)
    /root/.gopkg/src/github.com/pydio/cells/cmd/install-cli.go:154 +0xaa4
github.com/pydio/cells/cmd.glob..func24(0x4f5b8e0, 0x55846f0, 0x0, 0x0)
    /root/.gopkg/src/github.com/pydio/cells/cmd/install.go:173 +0x28bd
github.com/pydio/cells/vendor/github.com/spf13/cobra.(*Command).execute(0x4f5b8e0, 0x55846f0, 0x0, 0x0, 0x4f5b8e0, 0x55846f0)
    /root/.gopkg/src/github.com/pydio/cells/vendor/github.com/spf13/cobra/command.go:760 +0x2cc
github.com/pydio/cells/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x4f5ad00, 0xc000ac9ef8, 0xc00066dc20, 0x1)
    /root/.gopkg/src/github.com/pydio/cells/vendor/github.com/spf13/cobra/command.go:846 +0x2fd
github.com/pydio/cells/vendor/github.com/spf13/cobra.(*Command).Execute(0x4f5ad00, 0xc00066dc30, 0x1)
    /root/.gopkg/src/github.com/pydio/cells/vendor/github.com/spf13/cobra/command.go:794 +0x2b
github.com/pydio/cells/cmd.Execute()
    /root/.gopkg/src/github.com/pydio/cells/cmd/root.go:210 +0x128
main.main()
    /root/.gopkg/src/github.com/pydio/cells/main.go:110 +0x68

Anybody got any leads as to how to get around that? I’ve tried compiling Pydio with make dev and simple go build -o cells.

Hm, when I tried, some modules were not compatible with FreeBSD…

If we knew which ones are not compatible, we might be able to find replacements? Any ideas on how to search for those?

Can you check if you have the dbus package installed?

dbus package was indeed not installed, got it from Freebsd ports now. However, error message still persists:

root@Pydio5:~/.gopkg/src/github.com/pydio/cells # ./cells install

Welcome to Pydio Cells Home Edition installation
Pydio Cells Home Edition will be configured to run on this machine. Make sure to prepare the following data

  • IPs and ports for binding the webserver to outside world
  • MySQL 5.6+ (or MariaDB equivalent) server access
    Pick your installation mode when you are ready.

:heavy_check_mark: Command line (performed in this terminal)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xb801a8]

goroutine 1 [running]:
***/pydio/cells/vendor/github.com/zalando/go-keyring.Get(0x2d04804, 0x13, 0x2cf55f6, 0xe, 0xc000805720, 0x203000, 0x203000, 0x2ce5b66)
/root/.gopkg/src/github.com/pydio/cells/vendor/github.com/zalando/go-keyring/keyring.go:32 +0x28
***/pydio/cells/common/crypto.GetKeyringPassword(0x2d04804, 0x13, 0x2cf55f6, 0xe, 0x0, 0x98, 0x2b33c80, 0xc000c3d0e0, 0x100000000000000, 0x0)
/root/.gopkg/src/github.com/pydio/cells/common/crypto/keyring.go:33 +0x56
***/pydio/cells/common/config/vault.(VaultSource).initMasterPassword(0xc000805720)
/root/.gopkg/src/github.com/pydio/cells/common/config/vault/source.go:152 +0xe8
***/pydio/cells/common/config/vault.NewVaultSource(0xc0008348d0, 0x2a, 0xc000834900, 0x29, 0x0, 0x0, 0x0, 0x0, 0xc000c3ab40)
/root/.gopkg/src/github.com/pydio/cells/common/config/vault/source.go:51 +0x184
***/pydio/cells/common/config.Vault.func1()
/root/.gopkg/src/github.com/pydio/cells/common/config/secrets.go:47 +0x374
sync.(Once).Do(0x55b5b60, 0x2e1c860)
/usr/local/go/src/sync/once.go:44 +0xb3
***/pydio/cells/common/config.Vault(0xc000a0ec60, 0x271ef80)
/root/.gopkg/src/github.com/pydio/cells/common/config/secrets.go:28 +0x39
***/pydio/cells/common/config.Set(0x271ef80, 0xc000a07450, 0xc000bcbd40, 0x2, 0x2)
/root/.gopkg/src/github.com/pydio/cells/common/config/vars.go:168 +0x17d
***/pydio/cells/cmd.glob…func23(0x4f8c980, 0x55b5a60, 0x0, 0x0)
/root/.gopkg/src/github.com/pydio/cells/cmd/install-cli.go:172 +0x7a6
***/pydio/cells/cmd.glob…func24(0x4f8c980, 0x55b5a60, 0x0, 0x0)
/root/.gopkg/src/github.com/pydio/cells/cmd/install.go:180 +0x29a8
***/pydio/cells/vendor/github.com/spf13/cobra.(Command).execute(0x4f8c980, 0x55b5a60, 0x0, 0x0, 0x4f8c980, 0x55b5a60)
/root/.gopkg/src/github.com/pydio/cells/vendor/github.com/spf13/cobra/command.go:760 +0x2cc
***/pydio/cells/vendor/github.com/spf13/cobra.(Command).ExecuteC(0x4f8bda0, 0xc000afbef8, 0xc000808d80, 0x1)
/root/.gopkg/src/
/pydio/cells/vendor/
**/spf13/cobra/command.go:846 +0x2fd
***/pydio/cells/vendor/***/spf13/cobra.(Command).Execute(0x4f8bda0, 0xc000808d90, 0x1)
/root/.gopkg/src/
**/pydio/cells/vendor/***/spf13/cobra/command.go:794 +0x2b
***/pydio/cells/cmd.Execute()
/root/.gopkg/src/***/pydio/cells/cmd/root.go:210 +0x128
main.main()
/root/.gopkg/src/***/pydio/cells/main.go:110 +0x68

Thank you for the pointer, any other ideas?

Hi there, sorry for the late reply. I’ve very recently installed Cells on FreeBSD as well, and all I needed to get it to compile was to make a tiny change: https://github.com/pydio/cells/issues/115

Here is what I did (quoting directly from GitHub):

This means that all that is required (for FreeBSD and other non-supported OSes) is to change github.com/pydio/cells/common/crypto/keyring.go to call keyring.MockInit() just after each function in that file.

Besides that, there are just some minor annoyances with the CLI (backspace does not really work) but everything else works quite well! (yay for Go!)

Oh, and this has nothing to do with dbus — just with the way go-keyring works. Out of the box, it only supports native keyrings on Windows, Linux, and macOS (maybe because FreeBSD does not offer a ‘native’ keyring solution at the OS level, I don’t know). Fortunately, the original developer of the go-keyring package offers a function to deal with other OSes, and it’s simple to change the few lines to get it to work on FreeBSD as well (or any other OS that runs Go).

Wonderful. That did the trick! Cells up and running, now on to experiment with it.

Now I just have to remember to do the file changes everytime when I pull a new version from Git - unless your hack finds its way into the source code.

1 Like

Well, I did report it on GitHub and one of the devs replied the day after, so hopefully they’ll look into it :slight_smile:

1 Like

It looks like my joy was a bit premature… It does install and run properly, but only if you don’t use a certificate.

Certificate creation (self-signed as well as Let’s encrypt) fails during installation.

2019-06-02T18:39:20.942+0900 INFO pydio.gateway.proxy Restarting proxy {“caddyfile”: “\n\t\thttps://[Internal URL]:8080 {\n\t\tproxy /a [Internal URL]:34631 {\n\t\t\twithout /a\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\t\tproxy /auth/dex [Internal URL]:34654 {\n\t\t\tinsecure_skip_verify\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\t\tproxy /io :34626 {\n\t\t\theader_upstream Host [External URL]\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\t\tproxy /data :34626 {\n\t\t\theader_upstream Host [External URL]\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\t\tproxy /ws [Internal URL]:35331 {\n\t\t\twebsocket\n\t\t\twithout /ws\n\t\t}\n\t\tproxy /plug/ [Internal URL]:34634 {\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t\theader_downstream Cache-Control “public, max-age=31536000”\n\t\t}\n\t\tproxy /dav/ [Internal URL]:34697 {\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\n\t\tproxy /public/ [Internal URL]:34634 {\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\n\t\tproxy /user/reset-password/ [Internal URL]:34634 {\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\n\t\tproxy /robots.txt [Internal URL]:34634 {\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\n\t\tproxy /login [Internal URL]:34634/gui {\n\t\t\twithout /login\n\t\t\theader_upstream Host {host}\n\t\t\theader_upstream X-Real-IP {remote}\n\t\t\theader_upstream X-Forwarded-Proto {scheme}\n\t\t}\n\n\t\tredir 302 {\n\t\t if {path} is /\n\t\t / /login\n\t\t}\n\n\t\t\n\t\t\n proxy /wopi/ [Internal URL]:34694 {\n transparent\n }\n\n proxy /loleaflet/ https://localhost:9980/loleaflet {\n transparent\n insecure_skip_verify\n without /loleaflet/\n }\n\n proxy /hosting/discovery https://localhost:9980/hosting/discovery {\n transparent\n insecure_skip_verify\n without /hosting/discovery\n }\n\n proxy /lool/ https://localhost:9980/lool/ {\n transparent\n insecure_skip_verify\n websocket\n without /lool/\n }\n \n\t\t\n\n\t\trewrite {\n\t\t\tif {path} not_starts_with “/a/”\n\t\t\tif {path} not_starts_with “/auth/”\n\t\t\tif {path} not_starts_with “/io”\n\t\t\tif {path} not_starts_with “/data”\n\t\t\tif {path} not_starts_with “/ws/”\n\t\t\tif {path} not_starts_with “/plug/”\n\t\t\tif {path} not_starts_with “/dav/”\n\t\t\t\n\t\t\tif {path} not_starts_with “/wopi/”\n\t\t\t\n\t\t\tif {path} not_starts_with “/loleaflet/”\n\t\t\t\n\t\t\tif {path} not_starts_with “/hosting/discovery”\n\t\t\t\n\t\t\tif {path} not_starts_with “/lool/”\n\t\t\t\n\t\t\tif {path} not_starts_with “/public/”\n\t\t\tif {path} not_starts_with “/user/reset-password”\n\t\t\tif {path} not_starts_with “/robots.txt”\n\t\t\tto {path} {path}/ /login\n\t\t}\n\n\t\ttls[Letsencrypt Email]\n\t\terrors “/root/.config/Pydio/cells/logs/caddy_errors.log”\n\t\t}\n\n\t\t\n\t”}

Looking at the Caddy error log file, I see it empty.

It is probably a real simple error, but looking through the sourcefiles, I can not locate where all these linebreaks stem from.

Hmmm sorry to hear that — on my test installation, I first did as you did (no certificates) and then moved on to using my client’s own certificate, and Cells had absolutely no problem with that. As far as I remember, I just made a quick test with Let’s Encrypt, nothing seemed to happen (no errors though), and didn’t even test self-signed certificates…

Are you able to get a Let’s Encrypt certificate separately from the Cells installation? If so, you could try to figure out if Cells works with it — if the certificate hasn’t been generated by Cells, it’ll be handling it an ‘external’ certificate, and AFAIK, Cells will not maliciously ‘reject’ the LE certificate just because it didn’t generate it :slight_smile:

I was having this issue and it was just that I needed to allow the port (443) through the firewall on my VM, oddly enough?! Not sure if this helps.