Giter VIP home page Giter VIP logo

Comments (19)

rajneshsiwal avatar rajneshsiwal commented on May 26, 2024

Any update ?

from cronicle.

jhuckaby avatar jhuckaby commented on May 26, 2024

Try this:

https://github.com/jhuckaby/Cronicle#server_comm_use_hostnames

server_comm_use_hostnames

Setting this parameter to 1 will force the Cronicle servers to connect to each other using hostnames rather than LAN IP addresses. This is mainly for special situations where your local server IP addresses may change, and you would prefer to rely on DNS instead. The default is 0 (disabled), meaning connect using IP addresses.

You may also need this one, depending on how your local machines connect to your network:

web_socket_use_hostnames

Setting this parameter to 1 will force Cronicle's Web UI to connect to the back-end servers using their hostnames rather than IP addresses. This includes both AJAX API calls and Websocket streams. You should only need to enable this in special situations where your users cannot access your servers via their LAN IPs, and you need to proxy them through a hostname (DNS) instead. The default is 0 (disabled), meaning connect using IP addresses.

from cronicle.

rajneshsiwal avatar rajneshsiwal commented on May 26, 2024

Thanks, jhuckaby. Will try that.
Do we need to update this in all master and slave Cronicles ?
Do we need to restart Cronicle after the modification ?

from cronicle.

jhuckaby avatar jhuckaby commented on May 26, 2024

Yes, all your servers should have the same exact configuration settings. Yup, this change requires a restart.

from cronicle.

rajneshsiwal avatar rajneshsiwal commented on May 26, 2024

I see the variables are already set to 1 in both master and slaves:
"server_comm_use_hostnames": 1,
"web_socket_use_hostnames": 1,

from cronicle.

rajneshsiwal avatar rajneshsiwal commented on May 26, 2024

config.json is synched between the master and the slave servers .
Are we still missing something that is forcing the master server to use IP instead of hostname

from cronicle.

jhuckaby avatar jhuckaby commented on May 26, 2024

Oh crap!! I see the problem here:

https://github.com/jhuckaby/Cronicle/blob/master/lib/job.js#L1123-L1124

This bit of code constructs the URL to fetch the job log, and it always uses the IP address. It doesn't honor the server_comm_use_hostnames setting. GAH!!

So sorry. I will get this fixed as soon as possible, and release a new version.

Thanks for reporting this!

from cronicle.

rajneshsiwal avatar rajneshsiwal commented on May 26, 2024

Let me try it.

from cronicle.

rajneshsiwal avatar rajneshsiwal commented on May 26, 2024

Please let us know when fixed. So we can update the Cronicle

from cronicle.

mpatel-cpi avatar mpatel-cpi commented on May 26, 2024

Looks like this issue is related to #26 and @jhuckaby the same fix should at least partially resolve that as well.

from cronicle.

jhuckaby avatar jhuckaby commented on May 26, 2024

Should be fixed in v0.6.16:
https://github.com/jhuckaby/Cronicle/releases/v0.6.16

Thanks for reporting this!

from cronicle.

mpatel-cpi avatar mpatel-cpi commented on May 26, 2024

Thanks @jhuckaby will roll out the fix.

from cronicle.

jenkins-deployer-cpi avatar jenkins-deployer-cpi commented on May 26, 2024

from cronicle.

jhuckaby avatar jhuckaby commented on May 26, 2024

@jenkins-deployer-cpi This is a completely different problem than the one you described before. This looks like a permission issue on your server. Did you start Cronicle as a non-root user? It doesn't have permissions to spawn a child process, which is highly irregular (root should have full permissions).

Make sure you become the superuser (root) or use "sudo" when starting Cronicle.

from cronicle.

jenkins-deployer-cpi avatar jenkins-deployer-cpi commented on May 26, 2024

from cronicle.

jhuckaby avatar jhuckaby commented on May 26, 2024

Whatever user you are running Cronicle as doesn't have permissions to launch the executable that is listed in your event or Plugin.

This is not an issue in Cronicle itself, but rather just a Node.js / Linux thing. Whatever process you are trying to launch in your event either doesn't have "execute" permissions (e.g. chmod a+x /path/to/executable), or the user itself doesn't have access to read the file / script executable.

Or it could be that the user Cronicle is running as doesn't have execute permissions to any of the parent directories outside the executable you are trying to launch.

Running Cronicle as root would also solve this.

from cronicle.

jenkins-deployer-cpi avatar jenkins-deployer-cpi commented on May 26, 2024

from cronicle.

jhuckaby avatar jhuckaby commented on May 26, 2024

Okay, I found more information. You didn't say that you were using the Shell Plugin (I don't have any information about your setup, nor your logs or config files, so I have to largely guess what is going on here). I can see in the stack trace that we are getting a failure inside the Shell Plugin right here:

	var script_file = path.join( os.tmpdir(), 'cronicle-script-temp-' + job.id + '.sh' );
	fs.writeFileSync( script_file, job.params.script, { mode: "775" } );
	
	var child = cp.spawn( script_file, [], { // CRASH HERE WITH EACCESS ERROR
		stdio: ['pipe', 'pipe', fs.openSync(job.log_file, 'a')] 
	} );

The Shell Plugin works by taking your shell script code (text) from the event and writing it out to a file in the server's temporary directory, setting its permissions to 0755, then spawning it. This is failing on your server, due to the permissions of the user you are running Cronicle as.

So your Cronicle user doesn't have access to the server's temporary directory (whatever Node.js returns from os.tmpdir()).

If you want to find out what Node.js is using as the temp dir, run this command (run it as the Cronicle user for most accurate results):

node -e 'console.log(require("os").tmpdir());'

Whatever that command outputs on your server is the directory Node.js is using to write temporary shell script files and then trying to execute (spawn) them.

You need to change your Linux server settings so that whatever user you are using to run Cronicle as has both read and execute permissions in this directory, and all of its parent directories.

Note that this issue has nothing to do with issue #29, nor the upgrade to fix it, and is a completely different problem altogether.

from cronicle.

rajneshsiwal avatar rajneshsiwal commented on May 26, 2024

Thanks

from cronicle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.