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
Timeout value for rpc timeout not used #607
Comments
the same issue |
i have the same issue
fatal: [xxx]: FAILED! => {"changed": false, "msg": "Failure committing the configuraton: RpcTimeoutError(host: xxx, cmd: commit-configuration, timeout: 30)"} fatal: [xxx]: FAILED! => { |
Same here. Fortunately, I have a dev server where it's taken into account. The only difference is juniper.device runs in 1.0.1. Force install 1.0.1 solve the issue : ansible-galaxy collection install juniper.device:==1.0.1 |
Ran into same issue. Putting timeout value in quotes fixed it for me.
I noticed similar behavior with the port setting. Although I had defined 830 it was still opening a connection over port 22. After putting the port value in quotes it started using port 830 as I had defined. Its confusing because the documentation shows timeout value as an int and port value as int or str |
I too have been running into this and it seems the only function of the task that does not use the provided timeout is the commit function. Adding the timeout value in quotes as previously described did not help me. Every other step in the config task from Open a candidate configuration database to Retrieve the configuration database from the Junos device uses the provided timeout value from the Ansible task. The commit step does not. From this output snippet, using
Potential Bug:I looked through the module code and I think I identified a potential bug. The function name is commit_configuration. The start of the function sets the default timeout to 30:
The commit is called later in the function and shows timeout=timeout:
Comparing this to previous functions, there never seems to be an instance where the commit_configuration calls the user defined timeout. Previous functions have the following in use and I believe a call to a user defined timeout if it exists is needed to resolve this issue. Example from the open function:
*** Edited this section to provide the correct code I meant to copy The commit_configuration just always calls it's own default. Workaround:ncclient times out at 30 seconds, but the router continues to commit fine so the configuration changes do go through. I worked around this by putting each config change in it's own block and adding a rescue that was a copy of the original task. Ansible's second attempt sees the config is there and moves right along with the next task fine. I have upgraded ~10-15 routers this way now and it appears to be a valid workaround. Example:
|
I was able to do a quick and dirty update to the juniper_junos_common.py and it seems to resolve the issue. I added the following code to the commit_configuration function:
Full function code:
|
Confirmed fix: After adding fix (with "timeout: '60'"): |
@chidanandpujar Can we fix this in the main code? The fix mentioned by @jnicholson56 is working fine for us. |
@chidanandpujar @jnicholson56 Can we create a PR for this? |
@vishnubraj I thought you were with juniper :D I am not against that but it seems like maybe no one is working this case actively. I am also unsure of the release cadence for this ansible package. |
Issue Type
Module Name
juniper.device.config
juniper.device collection and Python libraries version
OS / Environment
Juniper srx300 21.2R3-S2.9
Summary
The provided value for timeout isn't used in modules, so the playbook fails while commiting changes.
Steps to reproduce
Commit changes that take longer than 30s.
Expected results
Actual results
playbook stops with timeout error after 30s
The text was updated successfully, but these errors were encountered: