Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server IP & Live Log issue #691

Closed
ZachMassia opened this issue Dec 8, 2023 · 5 comments
Closed

Server IP & Live Log issue #691

ZachMassia opened this issue Dec 8, 2023 · 5 comments

Comments

@ZachMassia
Copy link

ZachMassia commented Dec 8, 2023

Summary

I'm having an issue with the live log, as for some reason the server IP address in Admin/Servers is listed as 127.0.0.1 (hostname correct though).

image

This causes the following to be displayed when trying to view a live log:

image

Once the job finishes, it refreshes and all the output is visible, no issue.

I am accessing the web UI through http and the machines direct IP.

Steps to reproduce the problem

Your Setup

I have a Debian machine running Cronicle at work.

I access it from my work laptop either at work on the same network, or through VPN when at home.

Operating system and version?

Debian 11 Bullseye

Node.js version?

v18.15.0

Cronicle software version?

0.9.20

Are you using the filesystem as back-end storage, or S3/Couchbase?

filesystem

Can you reproduce the crash consistently?

Not a crash, but happens every time.

I'm sure it's a simple config I missed somewhere!

Thanks

@jhuckaby
Copy link
Owner

jhuckaby commented Dec 8, 2023

Wow, that's an odd one.

When Cronicle starts up, it scans the local network interfaces, and picks the first interface with an IPv4 address, that is also marked as not internal:

https://github.com/jhuckaby/pixl-config/blob/master/config.js#L268-L277

Somehow this code is picking your server's 127.0.0.1 local loopback adapter, which very much SHOULD be marked as internal. What a weird situation. I've never seen this one before.

If your server has a fixed (static) IP address, you can probably get around this by placing the IP in your /opt/cronicle/conf/config.json config file as a top-level JSON property called ip. Example:

"ip": "1.2.3.4"

@ZachMassia
Copy link
Author

Weird, based on that logic, it should be grabbing the correct IP. All looks correct if I run os.networkInterfaces() in a node repl.

Local loopback is set to internal: true on both entries.

I made the config change and did a restart.

First job I ran, it seemed to have worked, but it was such a quick job I only saw it in "live" for a second before the refresh.

I did a second longer job, and it seems to have hung up after the first few lines (only Cronicle generated output though):

image

Once it finished, refresh and full log was present.

I'll see if it works any different next time I'm at the office.

@ZachMassia
Copy link
Author

Same thing when at the office.

Connects, but never shows any output.

@krasnyd
Copy link

krasnyd commented Dec 19, 2023

I have been running some Python script with Cronicle and I had the same issue as you - the live log showed me only these 4 lines. I solved it by adding export PYTHONUNBUFFERED=1. I don't know if it's your case, but it can be related to some log buffering in a script that you are running.

@ZachMassia
Copy link
Author

@krasnyd That was it!

I'm using Python as well, so that was a very quick test.

For anyone who might stumble on this, some alternative options for Python specifically are:

  • Run the script with the -u flag: python -u script.py
  • Pass flush=True to print()

Thanks guys! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants