When I execute this step, I have such a mistake. What should I do about it? Now my domain name opens the "HTTP ERROR 500", who can help me?


#1
[root@host mastodon]# docker-compose build
redis uses an image, skipping
db uses an image, skipping
Building streaming
Step 1/17 : FROM ruby:2.4.2-alpine3.6
---> c4efea625e1a
Step 2/17 : LABEL maintainer="https://github.com/tootsuite/mastodon" description="A GNU Social-compatible microblogging server"
---> Using cache
---> 260c884972b8
Step 3/17 : ENV UID=991 GID=991 RAILS_SERVE_STATIC_FILES=true RAILS_ENV=production NODE_ENV=production
---> Using cache
---> 51b0bfdbae64
Step 4/17 : ARG YARN_VERSION=1.1.0
---> Using cache
---> 59c3e76cec4d
Step 5/17 : ARG YARN_DOWNLOAD_SHA256=171c1f9ee93c488c0d774ac6e9c72649047c3f896277d88d0f805266519430f3
---> Using cache
---> f6d90e6692ab
Step 6/17 : ARG LIBICONV_VERSION=1.15
---> Using cache
---> 47b3d77d0194
Step 7/17 : ARG LIBICONV_DOWNLOAD_SHA256=ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178
---> Using cache
---> eb76fc492e50
Step 8/17 : EXPOSE 3000 4000
---> Using cache
---> 679dc46ff014
Step 9/17 : WORKDIR /mastodon
---> Using cache
---> 34102411dce0
Step 10/17 : RUN apk -U upgrade && apk add -t build-dependencies build-base icu-dev libidn-dev libressl libtool postgresql-dev protobuf-dev python && apk add ca-certificates ffmpeg file git icu-libs imagemagick libidn libpq nodejs nodejs-npm protobuf su-exec tini && update-ca-certificates && mkdir -p /tmp/src /opt && wget -O yarn.tar.gz "https://github.com/yarnpkg/yarn/releases/download/v$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" && echo "$YARN_DOWNLOAD_SHA256 yarn.tar.gz" | sha256sum -c - && tar -xzf yarn.tar.gz -C /tmp/src && rm yarn.tar.gz && mv /tmp/src/yarn-v$YARN_VERSION /opt/yarn && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn && wget -O libiconv.tar.gz "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$LIBICONV_VERSION.tar.gz" && echo "$LIBICONV_DOWNLOAD_SHA256 libiconv.tar.gz" | sha256sum -c - && tar -xzf libiconv.tar.gz -C /tmp/src && rm libiconv.tar.gz && cd /tmp/src/libiconv-$LIBICONV_VERSION && ./configure --prefix=/usr/local && make -j$(getconf _NPROCESSORS_ONLN) && make install && libtool --finish /usr/local/lib && cd /mastodon && rm -rf /tmp/ /var/cache/apk/
---> Using cache
---> 11b45311d81f
Step 11/17 : COPY Gemfile Gemfile.lock package.json yarn.lock .yarnclean /mastodon/
---> Using cache
---> 2ed2220e92da
Step 12/17 : RUN bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development && yarn --pure-lockfile && yarn cache clean
---> Running in d228c8636a3a
Fetching gem metadata from https://rubygems.org/..............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Fetching rake 12.1.0
....................................................................................................................................................
That's the same thing in the middle, ellipsis!............................................................
....................................................................................................................................................
Installing tzinfo-data 1.2017.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/mastodon/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.0/ext/nokogiri
/usr/local/bin/ruby -r ./siteconf20171019-8-1wfn0xq.rb extconf.rb
--with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include
Out of memory - /usr/local/bin/ruby -r ./siteconf20171019-8-1wfn0xq.rb
extconf.rb --with-iconv-lib=/usr/local/lib
--with-iconv-include=/usr/local/include 2>&1

Gem files will remain installed in
/mastodon/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.0 for inspection.
Results logged to
/mastodon/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/nokogiri-1.8.0/gem_make.out

An error occurred while installing nokogiri (1.8.0), and Bundler cannot
continue.
Make sure that gem install nokogiri -v '1.8.0' succeeds before bundling.

In Gemfile:
rails-settings-cached was resolved to 0.6.6, which depends on
rails was resolved to 5.1.4, which depends on
actioncable was resolved to 5.1.4, which depends on
actionpack was resolved to 5.1.4, which depends on
actionview was resolved to 5.1.4, which depends on
rails-dom-testing was resolved to 2.0.3, which depends on
nokogiri
ERROR: Service 'streaming' failed to build: The command '/bin/sh -c bundle config build.nokogiri --with-iconv-lib=/usr/local/lib --with-iconv-include=/usr/local/include && bundle install -j$(getconf _NPROCESSORS_ONLN) --deployment --without test development && yarn --pure-lockfile && yarn cache clean' returned a non-zero code: 5

Here’s some information

[root@host mastodon]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2076eb77c81d gargron/mastodon "/usr/local/bin/ru..." 6 seconds ago Up 4 seconds 3000/tcp, 4000/tcp mastodon_sidekiq_1
ec842c9ac71d gargron/mastodon "/usr/local/bin/ru..." 6 seconds ago Up 5 seconds 0.0.0.0:3000->3000/tcp, 4000/tcp mastodon_web_1
439cfd1a04a2 gargron/mastodon "/usr/local/bin/ru..." 6 seconds ago Up 4 seconds 3000/tcp, 0.0.0.0:4000->4000/tcp mastodon_streaming_1
1a24f4ff7864 redis:4.0-alpine "docker-entrypoint..." 7 seconds ago Up 6 seconds 6379/tcp mastodon_redis_1
88191cce4846 postgres:9.6-alpine "docker-entrypoint..." 7 seconds ago Up 6 seconds 5432/tcp mastodon_db_1
[root@host mastodon]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 18103/nginx: master
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1244/master
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 18103/nginx: master
tcp 0 0 0.0.0.0:26982 0.0.0.0:* LISTEN 770/sshd
tcp6 0 0 :::80 :::* LISTEN 18103/nginx: master
tcp6 0 0 :::3000 :::* LISTEN 21333/docker-proxy
tcp6 0 0 ::1:25 :::* LISTEN 1244/master
tcp6 0 0 :::4000 :::* LISTEN 21345/docker-proxy
tcp6 0 0 :::26982 :::* LISTEN 770/sshd

Here are some configuration files

[root@host mastodon]# cat /etc/nginx/nginx.conf
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name test.forxu.cn;
return 301 https://$host$request_uri;
}
server {
include /etc/nginx/mime.types;
listen 443 ssl;
server_name test.forxu.cn;
ssl_protocols TLSv1.2;
ssl_ciphers EECDH+AESGCM:EECDH+AES;
ssl_ecdh_curve prime256v1;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_certificate /home/key/fullchain.pem;
ssl_certificate_key /home/key/privkey.pem;
keepalive_timeout 70;
sendfile on;
client_max_body_size 0;
gzip off;

      root /home//web/mastodon/public;

      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

      location / {
        try_files $uri @proxy;
      }

      location @proxy {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_pass_header Server;
        proxy_pass http://localhost:3000;
        proxy_buffering off;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        tcp_nodelay on;
      }

      location /api/v1/streaming {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_pass http://localhost:4000;
        proxy_buffering off;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        tcp_nodelay on;
      }

      error_page 500 501 502 503 504 /500.html;
    }
}

events {
worker_connections 4096; ## Default: 1024
}
[root@host mastodon]# cat docker-compose.yml
version: '3'
services:

db:
restart: always
image: postgres:9.6-alpine

Uncomment to enable DB persistance

volumes:

- ./postgres:/var/lib/postgresql/data

redis:
restart: always
image: redis:4.0-alpine

Uncomment to enable REDIS persistance

volumes:

- ./redis:/data

web:
build: .
image: gargron/mastodon
restart: always
env_file: .env.production
command: bundle exec rails s -p 3000 -b '0.0.0.0'
ports:
- "3000:3000"
depends_on:
- db
- redis
volumes:
- ./public/assets:/mastodon/public/assets
- ./public/packs:/mastodon/public/packs
- ./public/system:/mastodon/public/system

streaming:
build: .
image: gargron/mastodon
restart: always
env_file: .env.production
command: npm run start
ports:
- "4000:4000"
depends_on:
- db
- redis

sidekiq:
build: .
image: gargron/mastodon
restart: always
env_file: .env.production
command: bundle exec sidekiq -q default -q mailers -q pull -q push
depends_on:
- db
- redis
volumes:
- ./public/system:/mastodon/public/system
[root@host mastodon]# cat .env.production
REDIS_HOST=redis
REDIS_PORT=6379
DB_HOST=db
DB_USER=postgres
DB_NAME=postgres
DB_PASS=
DB_PORT=5432
LOCAL_DOMAIN=test.forxu.cn
LOCAL_HTTPS=true

PAPERCLIP_SECRET=5ff1f5345ba1c4e99b6cb82afec81750b662210bb7b175f686adebb684fc67b1d4c316622fed2a01544e33bd3b026cb3931d21e7a4786d07cea7fe079906ce70
SECRET_KEY_BASE=db0591cc38b7dea96e44f66e5083298a9288dd02795684b917e167a8c46a83686a56662c4e0fe54fe26520d3d85b2fc0aa7bb1f74eaac99ded92fb0f0bc4f164
OTP_SECRET=0d43dece78234fc1555eb7b7de3138e7c41d14c6ddc3fa41d192fb711410148b851a81ef05eeca98a12973368bff4268c614a06618556123b55ce37e61ba7cd1

VAPID_PRIVATE_KEY=o0sCSNgnLd8r9NX9qLmIHc9Esuw6sMzHt72nHmUwLX4=
VAPID_PUBLIC_KEY=BH6seIsrdS2GJDrltbWtnisqgzFXMVADqiBe4Y-mI8wO7_FBmg6TESYbsqFfJTI2_sAShDcNtLP0zzjBWIqM-w8=
SMTP_SERVER=smtp.163.com
SMTP_PORT=587
SMTP_LOGIN=xuxiangxiaoup@163.com
SMTP_PASSWORD=xxxxxxxxxxxxxxxxxx
SMTP_FROM_ADDRESS=notifications@example.com
STREAMING_CLUSTER_NUM=1

Here’s another step: when I run “docker-compose run --rm web rake assets: precompile”, compilation fails

[root@host mastodon]# docker-compose run --rm web rake assets:precompile
Starting mastodon_redis_1 ...
Starting mastodon_redis_1 ... done
Creating mastodon user (UID : 991 and GID : 991)...
Updating permissions...
Executing process...
rake aborted!
ExecJS::RuntimeError:
(execjs):1
/mastodon/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:219:in exec_runtime' /mastodon/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:inexec'
/mastodon/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:in eval' /mastodon/vendor/bundle/ruby/2.4.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:46:incall'
/mastodon/vendor/bundle/ruby/2.4.0/gems/uglifier-3.2.0/lib/uglifier.rb:195:in run_uglifyjs' /mastodon/vendor/bundle/ruby/2.4.0/gems/uglifier-3.2.0/lib/uglifier.rb:157:incompile'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/compressing.rb:65:in block in js_compressor=' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy_proc_processor.rb:31:incall'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in call_processor' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:inblock in call_processors'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in reverse_each' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:incall_processors'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in load_from_unloaded' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:inblock in load'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in fetch_asset_from_dependency_cache' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:inload'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in block in initialize' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:inload'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in find_asset' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:infind_all_linked_assets'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in block in find' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:inblock (2 levels) in logical_paths'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in block in stat_tree' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:inblock in stat_directory'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in each' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:instat_directory'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in stat_tree' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:231:inblock in stat_tree'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in block in stat_directory' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:ineach'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in stat_directory' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:instat_tree'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in each' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:inblock in logical_paths'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in each' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:inlogical_paths'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in find' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:incompile'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in block (3 levels) in define' /mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:inwith_logger'
/mastodon/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in block (2 levels) in define' /mastodon/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in<top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

[root@host mastodon]# docker-compose run --rm web rake assets:precompile
Starting mastodon_redis_1 ...
Starting mastodon_db_1 ...
Starting mastodon_redis_1
Starting mastodon_redis_1 ... done
Creating mastodon user (UID : 991 and GID : 991)...
Updating permissions...
Executing process...
Webpacker is installed 🎉 🍰
Using /mastodon/config/webpacker.yml file for setting up webpack paths
Compiling…
Compilation failed:

This is my domain name: test.forxu.cn
If anyone would like to help me, please reply to me or send an email to xuxiangxiaoup@163.com,Thanks!
This is my questions and discussion on making: When I execute this step, I have such a mistake. What should I do about it? Now my domain name opens the "HTTP ERROR 500", who can help me? · Issue #5464 · tootsuite/mastodon · GitHub


#2

First you need to check why the build of nokogiri failed: