Misskey: 502 Bad Requset

Created on 13 Nov 2018  ·  38Comments  ·  Source: syuilo/misskey

Hello, I am new to here.
When I finish my installation, and open the website, it said error 502.
I tried to reboot the VPN and reload the mirror, but the issues is still going on.

🏳️Needs help

Most helpful comment

@syuilo @AyaMorisawa Please accept my sincere appreciation for your help.
Sorry about my poor English grammar xD.

All 38 comments

Thank you for your reporting.
Are you using Nginx? :)

Yes

ok thanks. Please show me your configuration of Misskey and nginx.

Okay, but could you please wait for a while, I am having dinner, sorry.

name: example-instance-name # Name of your instance
description: example-description # Description of your instance

maintainer:
  name: example-maitainer-name # Your name
  url: http://example.com/ # Your contact (http or mailto)

# Final accessible URL seen by a user.
url: https://misskey.never666.com/

# port: 3000    # A port that your Misskey server should listen.

mongodb:
  host: localhost
  port: 27017
  db: misskey
  user: misskey
  pass: 6631330Zhang

redis:
  host: localhost
  port: 6379
  pass: example-pass
ap $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

server {
    listen       80;
    listen       443 ssl http2;
    server_name  misskey.never666.com misskey.never666.com;
    client_max_body_size 100m;
    client_body_buffer_size 2048k;
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }

    ssl_certificate    /etc/letsencrypt/live/misskey.never666.com/fullchain.pem;
    ssl_certificate_key    /etc/letsencrypt/live/misskey.never666.com/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri;

location / {
    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_set_header Proxy "";
    proxy_pass_header Server;

    proxy_pass http://127.0.0.1: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;
  }
}

I use CentOS 7.4 X64

Thank you.
I think you need to uncomment the setting of the port.

# port: 3000    # A port that your Misskey server should listen.

to

port: 3000    # A port that your Misskey server should listen.

Oh, I am going to try it. Thank you very much!

Good luck!

Sorry, I tried a few times, but it still displayed 502.
The log said this:

[root@]# systemctl status misskey
● misskey.service - Misskey daemon
   Loaded: loaded (/etc/systemd/system/misskey.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Tue 2018-11-13 22:22:42 CST; 4s ago
  Process: 5301 ExecStart=/usr/bin/npm start (code=exited, status=1/FAILURE)
 Main PID: 5301 (code=exited, status=1/FAILURE)

Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: misskey.service: main process exited, code=exited, status=1/FAILURE
Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: Unit misskey.service entered failed state.
Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: misskey.service failed.
Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: misskey.service holdoff time over, scheduling restart.
Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: start request repeated too quickly for misskey.service
Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: Failed to start Misskey daemon.
Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: Unit misskey.service entered failed state.
Nov 13 22:22:42 iZj6cb7o9hu1q9z6pz4jswZ systemd[1]: misskey.service failed.

This is misskey.service

[Unit]
Description=Misskey daemon

[Service]
Type=simple
User=root
ExecStart=/usr/bin/npm start
WorkingDirectory=/root/misskey
TimeoutSec=60
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=misskey
Restart=always
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

Can you launch Misskey without Nginx?

emmm How to do it?

Please write config as:

port: 443

https:
  key: /etc/letsencrypt/live/misskey.never666.com/privkey.pem
  cert: /etc/letsencrypt/live/misskey.never666.com/fullchain.pem

The misskey config?

yes

name: example-instance-name # Name of your instance
description: example-description # Description of your instance

maintainer:
  name: Never # Your name
  url: http://never666.com/ # Your contact (http or mailto)

# Final accessible URL seen by a user.
url: https://misskey.never666.com/

  port: 3000    # A port that your Misskey server should listen.

port: 443

https:
  key: /etc/letsencrypt/live/misskey.never666.com/privkey.pem
  cert: /etc/letsencrypt/live/misskey.never666.com/fullchain.pem

mongodb:
  host: localhost
  port: 27017
  db: misskey
  user: misskey
  pass: example-pass

redis:
  host: localhost
  port: 6379
  pass: examle-pass

Is this right?

Seems port setting duplicated. remove this line:

port: 3000 # A port that your Misskey server should listen.

Okay, and then?

  1. Stop Nginx
  2. In your misskey directory, run npm start command

( By the way, have you checked journalctl -at misskey ? )

@AyaMorisawa Not yet

@syuilo It works!

[root@iZj6cb7o9hu1q9z6pz4jswZ misskey]# npm start

> [email protected] start /root/misskey
> node ./built

[22:53:41 INFO] Welcome to Misskey!
[22:53:41 INFO] <<< Misskey v10.49.1 >>>
[22:53:41 INFO] [Deps] Node.js v10.13.0
[22:53:41 INFO] [Machine] Hostname: iZj6cb7o9hu1q9z6pz4jswZ
[22:53:41 INFO] [Machine] Platform: linux
[22:53:41 INFO] [Machine] Architecture: x64
[22:53:41 INFO] [Machine] CPU: 2 core
[22:53:41 INFO] [Machine] MEM: 3.7GB (available: 3.2GB)
[22:53:41 INFO] [Env] NODE_ENV is not set
[22:53:41 WARN] [Env] The environment is not in production mode
[22:53:41 WARN] [Env] Do not use for production purpose
[22:53:41 INFO] [Env] You have root privileges
[22:53:41 INFO] [Config] Loaded
[22:53:41 INFO] [MongoDB] Connecting to mongodb://misskey:****@localhost:27017/misskey
[22:53:41 INFO] Misskey initialized
[22:53:41 INFO] Starting workers...
[22:53:44 INFO] All workers started
[22:53:44 INFO] Now listening on port 443 on https://
  <-- GET /
  --> GET / 200 18ms 2.07kb
  <-- GET /assets/locales/en-US.json
  --> GET /assets/locales/en-US.json 200 8ms 16.06kb
  <-- GET /favicon.ico
  --> GET /favicon.ico 200 5ms 5.15kb
  <-- GET /assets/desktop.2.0.11745.js
  <-- POST /api/meta
  --> POST /api/meta 200 450ms 560b
  --> GET /assets/desktop.2.0.11745.js 200 5,331ms 591.02kb
  <-- GET /assets/ai.png
  <-- POST /api/meta
  <-- POST /api/notes
  <-- POST /api/hashtags/trend
  <-- POST /api/aggregation/hashtags
  <-- POST /api/notes/local-timeline
  <-- POST /api/stats
  --> POST /api/notes 200 37ms 2b
  --> POST /api/notes/local-timeline 200 36ms 2b
  --> POST /api/meta 200 51ms 407b
  --> POST /api/hashtags/trend 200 38ms 2b
  --> POST /api/aggregation/hashtags 200 37ms 2b
  --> POST /api/stats 200 38ms 102b
  --> GET /assets/ai.png 200 741ms 220.19kb

Well done :)
Thank you @AyaMorisawa !

By the way, How can I let it keep on running when I disconnect from ssh? Use screen?

  1. npm i -g forever
  2. forever start ./built instead of npm start

Okay, well done

Thank you very much.
And sorry about disturbing

np!

@syuilo @AyaMorisawa Please accept my sincere appreciation for your help.
Sorry about my poor English grammar xD.

Excuse me again, how to set up an administrator account?

On console, type node cli/mark-admin.js @USER to become admin

@mei23 That works, thank you.

@syuilo Are there any ways to add translations and apply right now on the local server?

(@Never2333 When you have a question not related to the issue, please create a new issue. :pray: )

Was this page helpful?
0 / 5 - 0 ratings