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

Database locked errors during iosxe_interface_ethernet parallel creation with source_templates #201

Open
coffmant opened this issue Dec 13, 2024 · 2 comments
Labels
question Further information is requested

Comments

@coffmant
Copy link

IOS-XE 17.9.5

We are using a for_each loop to create iosxe_interface_ethernet interfaces en masse. Each port is using an iosxe_template to supply the interface parameters.

The first creation succeeds. Other creates that are running in parallel fail with this lock error.

Error: Client Error

with iosxe_interface_ethernet.ports["4/0/32"],
on iosxe_interface_ethernet.ports.tf line 1, in resource "iosxe_interface_ethernet" "ports":
1: resource "iosxe_interface_ethernet" "ports" {

Failed to configure object (PATCH), got error: HTTP Request failed:
StatusCode 409, RESTCONF errors {Error:[{ErrorType:application
ErrorTag:lock-denied ErrorAppTag:
ErrorPath:/Cisco-IOS-XE-native:native/interface/GigabitEthernet
ErrorMessage:the configuration database is locked by session 18
yang_mgmt_infra tcp (system from 127.0.0.1) on since 2024-12-13 17:52:56
IOS-XE YANG Infrastructure ErrorInfo:}]} {PatchId: GlobalStatus:{Ok:false Errors:{Error:[]}} EditStatus:{Edit:[]} Errors:{Error:[]}}

@coffmant
Copy link
Author

#show netconf-yang datastores
Datastore Name : running
Partial Lock ID : 61
Partially Locked By Session : 18
Partially Locked Time : 2024-12-16T21:18:47+00:00
Selected XPATHs : /native
Locked Nodes : /native

#clear netconf-yang session 18
% Error: Session 18 is internal, can't be killed

What exactly is going on with this session 18?

@danischm
Copy link
Member

Unfortunately, the RESTCONF implementation on XE returns a success response while the database is still locked. Therefore we have to rely on a retry mechanism. I assume it is eventually able to apply the configuration after running "terraform apply" again. If that is the case, the provider configuration has an attribute to change the number of retries, so you can try increasing it accordingly.

@danischm danischm added the question Further information is requested label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants