clusterio / clusterio

internet communication for factorio mods
Other
309 stars 68 forks source link

Trying to start master server getting an error #114

Closed e-3-s closed 6 years ago

e-3-s commented 6 years ago

Hi there,

I just wanted to start the master server instance but I get the following error.

[TAILING] Tailing last 15 lines for [master] process (change the value with --lines option) /home/buurthuis/.pm2/logs/master-out-0.log last 15 lines: 0|master | Generated new master authentication private key!

/home/buurthuis/.pm2/logs/master-error-0.log last 15 lines: 0|master | at Module.load (internal/modules/cjs/loader.js:566:32) 0|master | at tryModuleLoad (internal/modules/cjs/loader.js:506:12) 0|master | at Function.Module._load (internal/modules/cjs/loader.js:498:3) 0|master | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:83:21) 0|master | Error: listen EACCES 0.0.0.0:444 0|master | at Server.setupListenHandle [as _listen2] (net.js:1329:19) 0|master | at listenInCluster (net.js:1387:12) 0|master | at Server.listen (net.js:1475:7) 0|master | at Object. (/home/buurthuis/factoriocluster/factorioClusterio/master.js:947:10) 0|master | at Module._compile (internal/modules/cjs/loader.js:654:30) 0|master | at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) 0|master | at Module.load (internal/modules/cjs/loader.js:566:32) 0|master | at tryModuleLoad (internal/modules/cjs/loader.js:506:12) 0|master | at Function.Module._load (internal/modules/cjs/loader.js:498:3) 0|master | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:83:21)

This is my config file:

GNU nano 2.5.3 File: config.json

{ "comment": "Where factorio folder. Should be in the same folder as this config file.", "factorioDirectory": "factorio", "comment1": "IP players should connect to to join your servers, should be portforwarded and stuff", "publicIP": "192.168.1.118", "comment2": "IP the master web server runs at, can be ignored on the master system", "masterIP": "192.168.1.118", "commentMasterPort": "HTTP port for the master to listen to, set to 0 or an empty string to not listen for HTTP requests", "masterPort": 8080, "commentsslPort": "HTTPS port for the master to listen to. Set to 0 or an empty string to not use HTTPS.", "sslPort": 444, "sslCert": "database/certificates/cert.crt", "sslPrivKey": "database/certificates/cert.key", "commentMasterAuthToken": "Authentication token to connect to the master server. Find it in secret-api-token.txt on the master.", "masterAuthToken": "my_token", "commentAuthSecret": "This is a long random string used for generating authentication tokens. Do not share. Regenerates when secret-api-token.txt is deleted.", "masterAuthSecret": "secret" "comment3": "Your factorio.com username for factorio MP services, also username will be admin on new instances", "username": "", "comment4": "Token from your factorio.com profile page. Required for MP and mod manager services.", "token": "", "comment7": "Used for communication with the mod portal, not needed if you manage mods by hand", "factorio_version": "0.16.51", "__comment5": "General user settings", "verify_user_identity": true, "auto_pause": false, "allow_commands": "admins-only", "game_password": "", "description": "This server runs Clusterio", "visibility": { "public": true, "lan": true }, "__comment6": "Statistic gathering statistics, may affect server performance (master memory usage especially)", "itemStats": { "maxEntries": 60, "entriesPerSecond": 0.01666666667 }, "logItemTransfers": false, "uploadModsToMaster": true, "msBetweenCommands": 10, "allowRemoteCommandExecution": true }

Danielv123 commented 6 years ago

There is a possibility port 444 is taken up by SNPP (Simple Network Paging Protocol). You can "safely" disable https by setting the field to 0 if port 443 is taken already.

e-3-s commented 6 years ago

I changed the config.json ssl to 0 The master server does start up. But when I do node client.js start server1 It says missing token and alot of errors.

Getting the following error on the master server

/home/buurthuis/.pm2/logs/master-out-0.log last 15 lines: 0|master | Generated new master authentication private key!

/home/buurthuis/.pm2/logs/master-error-0.log last 15 lines: 0|master | at Module.load (internal/modules/cjs/loader.js:566:32) 0|master | at tryModuleLoad (internal/modules/cjs/loader.js:506:12) 0|master | at Function.Module._load (internal/modules/cjs/loader.js:498:3) 0|master | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:83:21) 0|master | Error: listen EADDRINUSE :::8080 0|master | at Server.setupListenHandle [as _listen2] (net.js:1346:14) 0|master | at listenInCluster (net.js:1387:12) 0|master | at Server.listen (net.js:1475:7) 0|master | at Object. (/home/buurthuis/factoriocluster/factorioClusterio/master.js:951:9) 0|master | at Module._compile (internal/modules/cjs/loader.js:654:30) 0|master | at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) 0|master | at Module.load (internal/modules/cjs/loader.js:566:32) 0|master | at tryModuleLoad (internal/modules/cjs/loader.js:506:12) 0|master | at Function.Module._load (internal/modules/cjs/loader.js:498:3) 0|master | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:83:21)

e-3-s commented 6 years ago

I just changed in the config.json file the masterPort to 0. and when I first start the master server it has no errors and does say online. But when I do the following command node client.js start server1 it goes in error. The output of that is the following:

Registered our precense with master 192.168.1.118 at 1529611874942 We got problems, something went wrong when contacting master { Error: connect ECONNREFUSED 192.168.1.118 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1174:14) errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '192.168.1.118' } Unable to get JSON master/api/inventory, master might be unaccessible ^CFactorio: 16.428 Received SIGINT, shutting down

the master server output tail is the following: [TAILING] Tailing last 15 lines for [master] process (change the value with --lines option) /home/buurthuis/.pm2/logs/master-out-0.log last 15 lines: 0|master | Generated new master authentication private key!

/home/buurthuis/.pm2/logs/master-error-0.log last 15 lines: 0|master | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:83:21) 0|master | at Module._compile (internal/modules/cjs/loader.js:654:30) 0|master | at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) 0|master | at Module.load (internal/modules/cjs/loader.js:566:32) 0|master | ReferenceError: server is not defined 0|master | at Object. (/home/buurthuis/factoriocluster/factorioClusterio/master.js:957:31) 0|master | at Module._compile (internal/modules/cjs/loader.js:654:30) 0|master | at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) 0|master | at Module.load (internal/modules/cjs/loader.js:566:32) 0|master | at tryModuleLoad (internal/modules/cjs/loader.js:506:12) 0|master | at Function.Module._load (internal/modules/cjs/loader.js:498:3) 0|master | at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:83:21) 0|master | at Module._compile (internal/modules/cjs/loader.js:654:30) 0|master | at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) 0|master | at Module.load (internal/modules/cjs/loader.js:566:32)

Danielv123 commented 6 years ago

So it seems you have something else running. I can't really help you without system access, but you need to pick a new port or kill the running process.

e-3-s commented 6 years ago

I wrote 0 in both the ports as you can see. Didn't work The weird thing is. The website http://192.168.1.118:8080/nodes is running. Also I get server1 info on that page.

server1 ID: -71113031 Last seen: 21.06.18, 10:04:43 Online players: 0 IP: 192.168.1.118:19853 Host: 00:25:90:7f:32:e8 Graph tools:

I can also connect with factorio to 192.168.1.118:19853 and join. But the terminal of the node client is still getting erros and the master server is in error.

Danielv123 commented 6 years ago

The normal HTTP port is required. If you write 0 on that one, it just defaults to 8080 instead of being disabled. You need to either set it to a free port or kill whatever is running on 8080. Google can help you with that.

Danielv123 commented 6 years ago

That means you already have a master running somewhere and are trying to start another one on the same port. Please don't do that, you will just confuse yourself.

Everything should be working then. Set masterPort back to 8080 and you're good.

You should probably find out where the master is running though, in case you need to restart it for updates or whatever.

e-3-s commented 6 years ago

Hi @Danielv123 Well I changed the port to 8081 and the master is still online. But when I start the client. With node client.js start server1. It does start. Also I can see the game in LAN in factorio. But I get the following error in the client output.

Factorio: 2018-06-21 22:57:56 Cannot execute command. Error: Unknown interface: clusterio stack traceback: [string "remote.call('clusterio', 'runcode', 'global.t..."]:1: in main chunk Also in the beginning of the output just when I run the command its says the following.

Factorio: 0.054 Error ModManager.cpp:677: Mod package read error. Opening zip /home/buurthuis/factoriocluster/factorioClusterio/instances/server1/mods/clusterio_1.12.0.zip failed: I/O error

UPDATE New error also found in the client output terminal:

Factorio: 1.000 Error ServerMultiplayerManager.cpp:633: Matching server connection failed: Error when creating server game: Missing token.

Danielv123 commented 6 years ago

This means something went wrong while downloading the clusterio lua mod from the mod portal. You can manually download a new copy from https://mods.factorio.com/mod/clusterio and drop it into /sharedMods to fix it.

To fix the matchmaking token, fill out the username and token fields in config.json with the values you get from factorio.com. These are only applied when you create new instances, if you want to add a token to an already created instance as well you have to modify /instances/[instanceName]/server-properties.json

e-3-s commented 6 years ago

Aright gonna try it right away. Another question does my laptop need where I play factorio on, the clustorio mod?

e-3-s commented 6 years ago

It worked. I am gonna try it out. I see the server1 also in the webpage. But after joining getting 40 fps....hmm

Danielv123 commented 6 years ago

To connect to a modded server you will need the mod, but not all of this complicated stuff. When you want to connect with your laptop you just download it from the portal like any other mod, but I think you got that figured out already.

If you have FPS problems those are probably related to your factorio settings not the mod. I usually turn off decoratives, smoke and clouds to get a playable framerate on my laptop.