pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.81k stars 1.74k forks source link

0.6.3 update console output issue #522

Closed nechtmarrie closed 7 years ago

nechtmarrie commented 7 years ago

After installing the 0.6.3 panel update the console for servers will read out the logging of the past +-3 houres 1 line at a time and appending it to the bottom of the console output. To see actual new command feedback/console logging you need to wait about 10 minuted for the log to finish reading.

DaneEveritt commented 7 years ago

That sounds like you have a very, very low throttle limit set, or an insane amount of data is being returned from the daemon, which shouldn't be the case.

/cc @Pterodactyl/support are you able to replicate this at all?

kgns commented 7 years ago

a lot of users have this, including me. whenever i navigate into the console page of any server, logs from 10-15 minutes ago start to spam it until it catches up. asked about this in #support channel of discord a few times too, no one really replied

DaneEveritt commented 7 years ago

@kaganus Can you do me a favor and see if modifying CONSOLE_PUSH_COUNT and CONSOLE_PUSH_FREQ has any effect on the issue you're seeing? Those default to 10 and 200 respectively, which means every 200ms 10 new lines are flushed to the console. Try changing those to push 100 lines every 100ms, or quicker depending on what you think.

You'll need to re-run php artisan config:cache each time you edit them, and they can be defined in the .env file.

Let me know if that makes any difference.

I believe the big change responsible for this behavior is that I modified the way data is output to the console to parse the initial server block line-by-line. What it was doing before was just putting the whole block into it the console as a single "line" which was much quicker. The daemon reads the last 80kB of the log file, which I am assuming is a large quantity of lines, or the daemon is actually not working correctly.

I can try to patch this behavior and send the text as a giant block when the page is rendered, it'll just take some playing around to figure out the best way, which might just be ploping all of those lines down into the console right at once, or reducing the amount of data being returned on load to begin with.

nechtmarrie commented 7 years ago

@DaneEveritt I had these values set to the following before changing them to the values you specified. CONSOLE_PUSH_FREQ=250 CONSOLE_PUSH_COUNT=10

Changed them to CONSOLE_PUSH_FREQ=200 CONSOLE_PUSH_COUNT=10

Still the same result i'm afraid.

schrej commented 7 years ago

I would just force print the initial log by replacing lines 126-128 in /public/themes/pterodactyl/js/frontend/console.js with

data.split(/\n/g).forEach(function (item) {
  $terminal.append(
    '<div class="cmd">' + AnsiUp.ansi_to_html(item + '\u001b[0m') + '</div>'
  );
});
window.scrollToBottom();

Or better, put that $terminal.append() stuff into a function and call it at both spots that need it to avoid duplicated code. That console thing needs a rewrite after that hotfix anyways though.

nechtmarrie commented 7 years ago

@schrej That fixed the issue for now :)

ygtripps commented 7 years ago

Dane is going through and cleaning up the console. I would expect an update for this soon enough.

DaneEveritt commented 7 years ago

closed in 7463bea

If you modified those environment variables, you may want to undo them, or set them to high limits that work for you as the defaults have changed to:

CONSOLE_PUSH_COUNT=50
CONSOLE_PUSH_FREQ=200
CONSOLE_OUTPUT_LIMIT=2000
DaneEveritt commented 7 years ago