Installing Diaspora on Debian 9

Hello,

I tried to install Diaspora on a fresh Debian 9 server, but I got this error when I try to start it

=====================================================
diaspora@diaspora-deb:~/diaspora$ ./script/server
Starting Diaspora in production mode with 1 Sidekiq worker(s).

/home/diaspora/diaspora/vendor/bundle/ruby/2.3.0/bin/loader_eye --stop_all -c config/eye.rb: symbol lookup error: /home/diaspora/diaspora/vendor/bundle/ruby/2.3.0/gems/sigar-0.7.3/lib/sigar.so: undefined symbol: sigar_skip_token

I found a solution here : https://github.com/hyperic/sigar/issues/60 with this command :

gem install sigar – --with-cppflags="-fgnu89-inline"

But it doesn’t solved my issue…

Any Idea ?

Here is a rvm info

ruby-2.3.3@diaspora:

system:
uname: "Linux diaspora-deb 4.4.44-1-pve #1 SMP PVE 4.4.44-84 (Thu, 9 Mar 2017 12:06:34 +0100) x86_64 GNU/Linux"
name: "Debian"
version: "9"
architecture: "x86_64"
bash: "/bin/bash => GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
remote path: “debian/9/x86_64”

rvm:
version: "rvm 1.29.2 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]"
updated: "15 hours 16 minutes 15 seconds ago"
path: "/home/diaspora/.rvm"
autolibs: “[enable] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X).”

ruby:
interpreter: "ruby"
version: "2.3.3p222"
date: "2016-11-21"
platform: "x86_64-linux"
patchlevel: "2016-11-21 revision 56859"
full_version: “ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]”

homes:
gem: "/home/diaspora/.rvm/gems/ruby-2.3.3@diaspora"
ruby: “/home/diaspora/.rvm/rubies/ruby-2.3.3”

binaries:
ruby: "/home/diaspora/.rvm/rubies/ruby-2.3.3/bin/ruby"
irb: "/home/diaspora/.rvm/rubies/ruby-2.3.3/bin/irb"
gem: "/home/diaspora/.rvm/rubies/ruby-2.3.3/bin/gem"
rake: “/home/diaspora/.rvm/rubies/ruby-2.3.3/bin/rake”

environment:
PATH: "/home/diaspora/.rvm/gems/ruby-2.3.3@diaspora/bin:/home/diaspora/.rvm/gems/ruby-2.3.3@global/bin:/home/diaspora/.rvm/rubies/ruby-2.3.3/bin:/home/diaspora/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
GEM_HOME: "/home/diaspora/.rvm/gems/ruby-2.3.3@diaspora"
GEM_PATH: "/home/diaspora/.rvm/gems/ruby-2.3.3@diaspora:/home/diaspora/.rvm/gems/ruby-2.3.3@global"
MY_RUBY_HOME: "/home/diaspora/.rvm/rubies/ruby-2.3.3"
IRBRC: "/home/diaspora/.rvm/rubies/ruby-2.3.3/.irbrc"
RUBYOPT: ""
gemset: “diaspora”

By advance thank you !

Camille.

Have you tried bin/bundle config --local build.sigar '--with-cppflags="-fgnu89-inline"', gem uninstall sigar and then bin/bundle install again?

I have installed a pod with debian 9, but I don’t use eye (./script/server) which is the thing that uses sigar. I start the services directly with systemd, which does the same things as eye does (start and monitor the processes and restart them when they crash). So there is no need to have an extra process running for that that only needs resources.

Hello Benjamin, I just tried your suggestions :

=====================================================

diaspora@diaspora-deb:~/diaspora$ bin/bundle config --local build.sigar '–with-cppflags="-fgnu89-inline"'
You are replacing the current local value of build.sigar, which is currently “–with-cppflags=\\\”-fgnu89-inline\\\""
diaspora@diaspora-deb:~/diaspora$ gem uninstall sigar
Successfully uninstalled sigar-0.7.3
diaspora@diaspora-deb:~/diaspora$ bin/bundle install
Fetching gem metadata from
Fetching gem metadata from
Fetching version metadata from
Fetching version metadata from
Fetching dependency metadata from /…
Fetching dependency metadata from /.
Fetching gem metadata from /…
Fetching version metadata from/…
Fetching dependency metadata from/…
Using rake 12.0.0
Using i18n 0.8.1
Using minitest 5.10.1
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.5
[…]
Using compass-rails 2.0.5
Using devise_lastseenable 0.0.6
Bundle complete! 136 Gemfile dependencies, 220 gems now installed.
Gems in the groups test and development were not installed.
Bundled gems are installed into ./vendor/bundle.
diaspora@diaspora-deb:~/diaspora$ ./script/server
Starting Diaspora in production mode with 1 Sidekiq worker(s).

/home/diaspora/diaspora/vendor/bundle/ruby/2.3.0/bin/loader_eye --stop_all -c config/eye.rb: symbol lookup error: /home/diaspora/diaspora/vendor/bundle/ruby/2.3.0/gems/sigar-0.7.3/lib/sigar.so: undefined symbol: sigar_skip_token

=====================================================

So, I got the same issue… :sob:

Camille.

Hey Benjamin, can I have your systemd’s configuration please ?

Thanks,

Sure:

diaspora.target:

[Unit]
Description=Diaspora social network
Wants=redis-server.service
After=redis-server.service

[Install]
WantedBy=multi-user.target

diaspora-web.service:

[Unit]
Description=Diaspora social network (unicorn)
PartOf=diaspora.target
StopWhenUnneeded=true

[Service]
User=diaspora
Environment=RAILS_ENV=production
WorkingDirectory=/path/to/diaspora
ExecStart=/bin/bash -lc "bin/bundle exec unicorn -c config/unicorn.rb -E production"
Restart=always

[Install]
WantedBy=diaspora.target

diaspora-sidekiq.service:

[Unit]
Description=Diaspora social network (sidekiq)
PartOf=diaspora.target
StopWhenUnneeded=true

[Service]
User=diaspora
Environment=RAILS_ENV=production
WorkingDirectory=/path/to/diaspora
ExecStart=/bin/bash -lc "bin/bundle exec sidekiq"
Restart=always

[Install]
WantedBy=diaspora.target

Please replace /path/to/diaspora with the path where you installed diaspora. You can also add the service needed for the database at Wants= and After= when it is on the same server, but my database is on another server, so I don’t have that.

You can then start/stop both together with diaspora.target or independently.

1 Like

OK thank you very much, I am soooo noob with Diaspora and Systemd…

I just created those files :

=============================================
diaspora@diaspora-deb:~$ cat /lib/systemd/system/diaspora.target
[Unit]
Description=Diaspora social network
Wants=redis-server.service
After=redis-server.service

[Install]
WantedBy=multi-user.target

diaspora@diaspora-deb:~$ cat /lib/systemd/system/diaspora-sidekiq.service
[Unit]
Description=Diaspora social network (sidekiq)
PartOf=diaspora.target
StopWhenUnneeded=true

[Service]
User=diaspora
Environment=RAILS_ENV=production
WorkingDirectory=/home/diaspora/diaspora
ExecStart=/bin/bash -lc "bin/bundle exec sidekiq"
Restart=always

[Install]
WantedBy=diaspora.target
diaspora@diaspora-deb:~$ cat /lib/systemd/system/diaspora-web.service
[Unit]
Description=Diaspora social network (unicorn)
PartOf=diaspora.target
StopWhenUnneeded=true

[Service]
User=diaspora
Environment=RAILS_ENV=production
WorkingDirectory=/home/diaspora/diaspora
ExecStart=/bin/bash -lc "bin/bundle exec unicorn -c config/unicorn.rb -E production"
Restart=always

[Install]
WantedBy=diaspora.target

It started I guess :

diaspora@diaspora-deb:~$ systemctl status diaspora.target

  • diaspora.target - Diaspora social network
    Loaded: loaded (/lib/systemd/system/diaspora.target; disabled; vendor preset: enabled)
    Active: active since Thu 2017-06-29 14:51:50 UTC; 8min ago

But nothing listen at 3000 port :

root@diaspora-deb:/home/diaspora/diaspora# ss -lntp |grep 3000

And in which file do I need to put my database service ? (for my case postgresql.service)

Thanks,

You need to enable all of them:

systemctl enable diaspora.target diaspora-sidekiq.service diaspora-web.service
systemctl restart diaspora.target

You can see if unicorn works with:

systemctl status diaspora-web.service

But by default it creates a file socket at /home/diaspora/diaspora/tmp/diaspora.sock, you can change it to port 3000 in the diaspora.yml.

The database service should go in diaspora.target:

[Unit]
Description=Diaspora social network
Wants=redis-server.service postgresql.service
After=redis-server.service postgresql.service

[Install]
WantedBy=multi-user.target

By the way: /lib/systemd/system/ is for unit-files installed from the system, you can create user-created units in /etc/systemd/system/. That is not a problem, just an info, both locations work.

Ok thank you Benjamin, I’m close to have my pod up ! But still got an error "diaspora-web.service: Failed to reset devices.list: Operation not permitted " :

root@diaspora-deb:~#  systemctl status diaspora-web.service
* diaspora-web.service - Diaspora social network (unicorn)
   Loaded: loaded (/etc/systemd/system/diaspora-web.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2017-07-04 08:24:39 UTC; 6h ago
 Main PID: 24957 (ruby)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/diaspora-web.service
           |-24957 unicorn master -c config/unicorn.rb -E production
           |-25269 unicorn worker[0] -c config/unicorn.rb -E production
           `-25272 unicorn worker[1] -c config/unicorn.rb -E production

Jul 04 08:24:39 diaspora-deb systemd[1]: diaspora-web.service: Failed to reset devices.list: Operation not permitted
Jul 04 08:24:39 diaspora-deb systemd[1]: Started Diaspora social network (unicorn).
Jul 04 08:24:40 diaspora-deb bash[24957]: I, [2017-07-04T08:24:40.190653 #24957]  INFO -- : Refreshing Gem list
Jul 04 08:24:48 diaspora-deb bash[24957]: I, [2017-07-04T08:24:48.478581 #24957]  INFO -- : listening on addr=0.0.0.0:3000 fd=
Jul 04 08:24:48 diaspora-deb bash[24957]: I, [2017-07-04T08:24:48.526666 #24957]  INFO -- : master process ready
Jul 04 08:24:48 diaspora-deb bash[24957]: I, [2017-07-04T08:24:48.533695 #25269]  INFO -- : worker=0 ready
Jul 04 08:24:48 diaspora-deb bash[24957]: I, [2017-07-04T08:24:48.537502 #25272]  INFO -- : worker=1 ready

It’s looks good :

root@diaspora-deb:~# curl -I 127.0.0.1:3000
HTTP/1.1 302 Found
Date: Tue, 04 Jul 2017 15:15:40 GMT
Connection: close
X-Diaspora-Version: 0.6.6.0-p7aadadce
X-Git-Update: 2017-05-29 03:20:38 +0200
X-Git-Revision: 7aadadce4484d2212994cfb314fdb64716dc8803
Location: http://127.0.0.1:3000/podmin
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Set-Cookie: _diaspora_session=ZHdRQ0gxQnozMExCMDkxL3VydUxjUDhUTTNFY3hNTUFDSEhwR0JvS250ZGQzc3ZUNm9EVzZjTXdsWmh5Q2k1VGVUbkk3cWNObWI3czVFL1M0dFRKeUxYaFZhYUEySVNNNEhRSlZnT2hHalNUZ2h6V3ZEQVdkUHJablNzVUdlOUEtLTZvQUlsNzNZNjIxQVgyMnQzd3k2YUE9PQ%3D%3D--1efcb3e66ddcb2a7fb2c108ab19cd6b4010dda3e; path=/; HttpOnly
X-Request-Id: a3303ca8-79d8-4763-b330-689d92a0ac08
X-Runtime: 0.005810
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: sameorigin
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Vary: Accept-Encoding

But the display is ugly (no css) I got this in the logs :

==> /home/diaspora/diaspora/log/production.log <==
[2017-07-04T15:21:15] INFO  PID-25272 TID-47099318841540 Rails: Started GET "/podmin" for 89.107.168.195 at 2017-07-04 15:21:15 +0000
[2017-07-04T15:21:15] INFO  PID-25272 TID-47099318841540 ActionController::Base: Processing by HomeController#podmin as HTML
  Rendered home/podmin.haml within layouts/with_header_with_footer (2.8ms)
  Rendered shared/_links.haml (2.2ms)
  Rendered layouts/_footer.html.haml (7.0ms)
  Rendered layouts/_header_not_connected.haml (0.8ms)
  Rendered layouts/_header.html.haml (1.7ms)
  Rendered application/_head.haml (12.0ms)
  Rendered layouts/application.html.haml (26.4ms)
  Rendered layouts/with_header.html.haml (28.7ms)
[2017-07-04T15:21:15] INFO  PID-25272 TID-47099318841540 ActionController::Base: Completed 200 OK in 43ms (Views: 39.5ms | ActiveRecord: 0.0ms)
[2017-07-04T15:21:15] INFO  PID-25269 TID-47099318841540 Rails: Started GET "/assets/jquery2-32b0ecbb2ae971189d8e4b8304c38134.js" for 89.107.168.195 at 2017-07-04 15:21:15 +0000
[2017-07-04T15:21:15] INFO  PID-25272 TID-47099318841540 Rails: Started GET "/assets/jquery_ujs-935898b80e784f61e070602f51468004.js" for 89.107.168.195 at 2017-07-04 15:21:15 +0000
[2017-07-04T15:21:15] FATAL PID-25269 TID-47099318841540 Rails: 
ActionController::RoutingError (No route matches [GET] "/assets/jquery2-32b0ecbb2ae971189d8e4b8304c38134.js"):
  lib/rack/internet_explorer_version.rb:34:in `call'

[2017-07-04T15:21:15] FATAL PID-25272 TID-47099318841540 Rails: 
ActionController::RoutingError (No route matches [GET] "/assets/jquery_ujs-935898b80e784f61e070602f51468004.js"):
  lib/rack/internet_explorer_version.rb:34:in `call'

Obviously I missed something, If you have an idea…

And no https for the moment, I need to take time to do this.

Thanks for all.

I can’t reproduce this error here, everything works fine. But the error message seems to be no real problem, because it’s running.

But when you get no css/js, you either haven’t setup a reverse-proxy to serve the static files or you didn’t precompile the static files. Because it tries to load the js directly from the app-server (No route matches [GET] "/assets/jquery2-32b0ecbb2ae971189d8e4b8304c38134.js"). See: https://wiki.diasporafoundation.org/Installation/Debian/Jessie#Reverse_proxy

Ok nice, my pod is up ! :smile:

Thank you !!!

I’m trying to upgrade my Diaspora Docker image from jessie to stretch-slim, and I’m getting the same error described by the poster (/home/diaspora/diaspora/vendor/bundle/ruby/2.4.0/bin/loader_eye --stop_all -c config/eye.rb: symbol lookup error: /home/diaspora/diaspora/vendor/bundle/ruby/2.4.0/gems/sigar-0.7.3/lib/sigar.so: undefined symbol: sigar_skip_token). What’s the right way to overcome this error?

The Dockerfile I use to make the image is here.

I added the commands mentioned by @supertux88 into this patch to my build, and things seem to we working now.

Thanks!

I have a build over buster available (using ruby:buster-slim as base image) available here if you want : https://github.com/sebt3/diaspora-pi/tree/master/docker