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

IOS-XE sync problem #345

Open
solanek opened this issue Nov 26, 2024 · 11 comments
Open

IOS-XE sync problem #345

solanek opened this issue Nov 26, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@solanek
Copy link

solanek commented Nov 26, 2024

hi,
i try to sync cisco WS-C3850-12X48U with bellow conf:
`source:

  • name: switch
    type: ios-xe
    hostname: 192.168.1.88
    username: username
    password: password
    validateCert: False
    hostTenantRelations:
    • .* = MyTenant
      hostSiteRelations:
    • .* = MySite
      vlanTenantRelations:
    • .* = MyTenant
      collectArpData:
      true`

output:
2024/11/26 09:22:26 add_items.go:31 DEBUG (switch): Tag Source: switch already exists in Netbox and is up to date... 2024/11/26 09:22:26 add_items.go:31 DEBUG (switch): Tag ios-xe already exists in Netbox and is up to date... 2024/11/26 09:22:26 main.go:80 INFO (switch): Successfully created source ✓ 2024/11/26 09:22:26 main.go:81 DEBUG (switch): Source content: &{{%!s(*logger.Logger=&{0xc0006ad9e0 0}) SourceConfig{Name: switch, Type: ios-xe, HTTPScheme: https, Hostname: 192.168.1.88, Port: 443, Username: user, Password: password, PermittedSubnets: [], ValidateCert: false, Tag: Source: switch, TagColor: 0d294f, DatacenterClusterGroupRelations: [], HostSiteRelations: [.* = MySite], ClusterSiteRelations: [], clusterTenantRelations: [], HostTenantRelations: [.* = MyTenant], VmTenantRelations [], VlanGroupRelations: [], VlanTenantRelations: [.* = MyTenant], WlanTenantRelations: []} [Tag{Name: Source: switch} Tag{Name: ios-xe}] %!s(*x509.CertPool=<nil>) context.Background.WithValue(constants.CtxKey, main).WithValue(constants.CtxKey, switch) } {{ } } map[] [] <nil> map[] map[] map[] map[] map[]} 2024/11/26 09:22:26 main.go:92 INFO (switch): Initializing source 2024/11/26 09:22:26 main.go:95 **ERROR (switch): failed to open driver: read /dev/ptmx: input/output error** 2024/11/26 09:22:26 main.go:126 INFO (main): Skipping removing orphaned objects because run failed... 2024/11/26 09:22:26 main.go:136 INFO (main): ⚠ syncing of source switch failed

i use docker with ghcr.io/bl4ko/netbox-ssot image @bl4ko any idea ?

@bl4ko
Copy link
Owner

bl4ko commented Nov 26, 2024

Hello,
your config looks fine, this is an error related to (switch): failed to open driver: read /dev/ptmx: input/output error.

Can you provide docker command that you have used?

For me this command on my local switch works fine:

docker run -v ./config.yaml:/app/config.yaml -v ./sub.pem:/app/sub.pem ghcr.io/bl4ko/netbox-ssot:latest

@bl4ko
Copy link
Owner

bl4ko commented Nov 26, 2024

Also did you try to sync any other source than ios-xe?

@solanek
Copy link
Author

solanek commented Nov 26, 2024

@bl4ko i just solve a problem - missing port:
- name: switch type: ios-xe hostname: 192.168.1.88 **port: 830** username: USERNAME password: PASSWORD validateCert: False hostTenantRelations: - .* = MyTenant hostSiteRelations: - .* = MySite vlanTenantRelations: - .* = MyTenant collectArpData: true
maybe you can add it in example ;):

now i have other problem:

2024/11/26 11:48:31 add_items.go:849    DEBUG   (prodprox): VM interface vtnet6 does not exist in Netbox. Creating it...
2024/11/26 11:48:31 rest.go:137         DEBUG   (prodprox): Creating objects.VMInterface with path /api/virtualization/interfaces/ with data: VMInterface{Name: vtnet6, VM: opensense-backup}
fatal error: all goroutines are asleep - deadlock!

goroutine 1 [semacquire, 3 minutes]:
sync.runtime_Semacquire(0xc000ecc9f0?)
        /usr/local/go/src/runtime/sema.go:71 +0x25
sync.(*WaitGroup).Wait(0xc000023030?)
        /usr/local/go/src/sync/waitgroup.go:118 +0x48
main.main()
        /app/cmd/netbox-ssot/main.go:114 +0xaca

goroutine 49 [semacquire, 3 minutes]:
sync.runtime_Semacquire(0xc0011d9760?)
        /usr/local/go/src/runtime/sema.go:71 +0x25
sync.(*WaitGroup).Wait(0xc000bc1da0?)
        /usr/local/go/src/sync/waitgroup.go:118 +0x48
github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs(0xc000895880, 0xc00061f400)
        /app/internal/source/proxmox/proxmox_sync.go:198 +0x132
github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).Sync(0xc000895880, 0xc00061f400)
        /app/internal/source/proxmox/proxmox.go:110 +0x2bd
main.main.func1({0x13eab88, 0xc000ecc720}, {0x13e83e0, 0xc000895880})
        /app/cmd/netbox-ssot/main.go:104 +0x2cd
created by main.main in goroutine 1
        /app/cmd/netbox-ssot/main.go:84 +0x69c

goroutine 282 [chan send, 3 minutes]:
github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs.func1(0xc000ebc380?, 0x0?)
        /app/internal/source/proxmox/proxmox_sync.go:192 +0xa5
created by github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs in goroutine 49
        /app/internal/source/proxmox/proxmox_sync.go:186 +0x19b

goroutine 356 [chan send, 3 minutes]:
github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs.func1(0x45218f9737f27505?, 0x9f2db388e21001a9?)
        /app/internal/source/proxmox/proxmox_sync.go:192 +0xa5
created by github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs in goroutine 49
        /app/internal/source/proxmox/proxmox_sync.go:186 +0x19b

@solanek
Copy link
Author

solanek commented Nov 26, 2024

also can you add support for ignore ipv6 in ignoredSubnets ?
line 22: cannot unmarshal !!str("fe80"... into []string

@bl4ko
Copy link
Owner

bl4ko commented Nov 26, 2024

also can you add support for ignore ipv6 in ignoredSubnets ? line 22: cannot unmarshal !!str("fe80"... into []string

IPv6 should work in a config, there is also a test for it that passes test and corresponding test config file. Could you maybe provide your whole config?

@bl4ko
Copy link
Owner

bl4ko commented Nov 26, 2024

@bl4ko i just solve a problem - missing port: - name: switch type: ios-xe hostname: 192.168.1.88 **port: 830** username: USERNAME password: PASSWORD validateCert: False hostTenantRelations: - .* = MyTenant hostSiteRelations: - .* = MySite vlanTenantRelations: - .* = MyTenant collectArpData: true maybe you can add it in example ;):

now i have other problem: `2024/11/26 11:48:31 add_items.go:849 DEBUG (prodprox): VM interface vtnet6 does not exist in Netbox. Creating it... 2024/11/26 11:48:31 rest.go:137 DEBUG (prodprox): Creating objects.VMInterface with path /api/virtualization/interfaces/ with data: VMInterface{Name: vtnet6, VM: opensense-backup} fatal error: all goroutines are asleep - deadlock!

goroutine 1 [semacquire, 3 minutes]: sync.runtime_Semacquire(0xc000ecc9f0?) /usr/local/go/src/runtime/sema.go:71 +0x25 sync.(*WaitGroup).Wait(0xc000023030?) /usr/local/go/src/sync/waitgroup.go:118 +0x48 main.main() /app/cmd/netbox-ssot/main.go:114 +0xaca

goroutine 49 [semacquire, 3 minutes]: sync.runtime_Semacquire(0xc0011d9760?) /usr/local/go/src/runtime/sema.go:71 +0x25 sync.(*WaitGroup).Wait(0xc000bc1da0?) /usr/local/go/src/sync/waitgroup.go:118 +0x48 github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs(0xc000895880, 0xc00061f400) /app/internal/source/proxmox/proxmox_sync.go:198 +0x132 github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).Sync(0xc000895880, 0xc00061f400) /app/internal/source/proxmox/proxmox.go:110 +0x2bd main.main.func1({0x13eab88, 0xc000ecc720}, {0x13e83e0, 0xc000895880}) /app/cmd/netbox-ssot/main.go:104 +0x2cd created by main.main in goroutine 1 /app/cmd/netbox-ssot/main.go:84 +0x69c

goroutine 282 [chan send, 3 minutes]: github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs.func1(0xc000ebc380?, 0x0?) /app/internal/source/proxmox/proxmox_sync.go:192 +0xa5 created by github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs in goroutine 49 /app/internal/source/proxmox/proxmox_sync.go:186 +0x19b

goroutine 356 [chan send, 3 minutes]: github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs.func1(0x45218f9737f27505?, 0x9f2db388e21001a9?) /app/internal/source/proxmox/proxmox_sync.go:192 +0xa5 created by github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs in goroutine 49 /app/internal/source/proxmox/proxmox_sync.go:186 +0x19b`

Well this is an odd gorutine (parallel) problem that shouldn't happen. Are you syncing multiple proxmox sources?

For the port, yeah I agree it should be 830 by default and I will fix it in the readme.

@bl4ko bl4ko added the bug Something isn't working label Nov 26, 2024
@solanek
Copy link
Author

solanek commented Nov 26, 2024

@bl4ko i just solve a problem - missing port: - name: switch type: ios-xe hostname: 192.168.1.88 **port: 830** username: USERNAME password: PASSWORD validateCert: False hostTenantRelations: - .* = MyTenant hostSiteRelations: - .* = MySite vlanTenantRelations: - .* = MyTenant collectArpData: true maybe you can add it in example ;):
now i have other problem: 2024/11/26 11:48:31 add_items.go:849 DEBUG (prodprox): VM interface vtnet6 does not exist in Netbox. Creating it... 2024/11/26 11:48:31 rest.go:137 DEBUG (prodprox): Creating objects.VMInterface with path /api/virtualization/interfaces/ with data: VMInterface{Name: vtnet6, VM: opensense-backup} fatal error: all goroutines are asleep - deadlock! goroutine 1 [semacquire, 3 minutes]: sync.runtime_Semacquire(0xc000ecc9f0?) /usr/local/go/src/runtime/sema.go:71 +0x25 sync.(*WaitGroup).Wait(0xc000023030?) /usr/local/go/src/sync/waitgroup.go:118 +0x48 main.main() /app/cmd/netbox-ssot/main.go:114 +0xaca goroutine 49 [semacquire, 3 minutes]: sync.runtime_Semacquire(0xc0011d9760?) /usr/local/go/src/runtime/sema.go:71 +0x25 sync.(*WaitGroup).Wait(0xc000bc1da0?) /usr/local/go/src/sync/waitgroup.go:118 +0x48 github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs(0xc000895880, 0xc00061f400) /app/internal/source/proxmox/proxmox_sync.go:198 +0x132 github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).Sync(0xc000895880, 0xc00061f400) /app/internal/source/proxmox/proxmox.go:110 +0x2bd main.main.func1({0x13eab88, 0xc000ecc720}, {0x13e83e0, 0xc000895880}) /app/cmd/netbox-ssot/main.go:104 +0x2cd created by main.main in goroutine 1 /app/cmd/netbox-ssot/main.go:84 +0x69c goroutine 282 [chan send, 3 minutes]: github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs.func1(0xc000ebc380?, 0x0?) /app/internal/source/proxmox/proxmox_sync.go:192 +0xa5 created by github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs in goroutine 49 /app/internal/source/proxmox/proxmox_sync.go:186 +0x19b goroutine 356 [chan send, 3 minutes]: github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs.func1(0x45218f9737f27505?, 0x9f2db388e21001a9?) /app/internal/source/proxmox/proxmox_sync.go:192 +0xa5 created by github.com/bl4ko/netbox-ssot/internal/source/proxmox.(*ProxmoxSource).syncVMs in goroutine 49 /app/internal/source/proxmox/proxmox_sync.go:186 +0x19b

Well this is an odd gorutine (parallel) problem that shouldn't happen. Are you syncing multiple proxmox sources?

For the port, yeah I agree it should be 830 by default and I will fix it in the readme.

it's 1 proxmox sources but in cluster mode, also it's possible to somehow map ex: vmbr0.51 to vlan51 (vid 51) ?
also next ERROR
2024/11/26 13:10:14 ERROR (prodprox): sync vm networks: add vm interface VMInterface{Name: vlan0.51, VM: opensense}: unexpected status code: 400: {"all":["Unknown field name 'orphan_last_seen' in custom field data."]}

netbox:
  apiToken: "......."
  hostname: "192.168.11.122"
  httpScheme: http
  port: 8000
  timeout: 30
  removeOrphans: false
  sourcePriority: ["prodprox","switch"] # Not required, but recommended

source:
  - name: prodprox
    type: proxmox
    username: root@pam
    password: PASSWORD
    hostname: 192.168.30.3
    port: 8006
    validateCert: false
    interfaceFilter: (cali|vxlan|flannel|docker|[a-f0-9]{15}|vmbr|vtnet|lo|veth)
    ignoredSubnets: ["127.0.0.0/8","fe80::/64","::1/128"]
    clusterSiteRelations:
    - .* = home`
  - name: switch
    type: ios-xe
    hostname: 192.168.1.88
    port: 830
    username: username
    password: password
    validateCert: False
    ignoredSubnets: ["127.0.0.0/8","fe80::/64","192.168.1.0/24"]
    hostTenantRelations:
      - .* = MyTenant
    hostSiteRelations:
      - .* = home
    vlanTenantRelations:
      - .* = MyTenant
    collectArpData:
      true

@bl4ko
Copy link
Owner

bl4ko commented Nov 26, 2024

also it's possible to somehow map ex: vmbr0.51 to vlan51 (vid 51) ?

This is currently not implemented, could you open separate feature request for this?

2024/11/26 13:10:14 ERROR (prodprox): sync vm networks: add vm interface VMInterface{Name: vlan0.51, VM: opensense}: unexpected status code: 400: {"all":["Unknown field name 'orphan_last_seen' in custom field data."]}

Are you running latest version, because I think this should work in latest?

@solanek
Copy link
Author

solanek commented Nov 26, 2024

also it's possible to somehow map ex: vmbr0.51 to vlan51 (vid 51) ?

This is currently not implemented, could you open separate feature request for this?

2024/11/26 13:10:14 ERROR (prodprox): sync vm networks: add vm interface VMInterface{Name: vlan0.51, VM: opensense}: unexpected status code: 400: {"all":["Unknown field name 'orphan_last_seen' in custom field data."]}

Are you running latest version, because I think this should work in latest?

yes, i used lasted version 1.6.1, also maybe you can add which version is running ?

@bl4ko
Copy link
Owner

bl4ko commented Nov 26, 2024

Yeah, I will add a version that is running to the start of the logs...

@bl4ko
Copy link
Owner

bl4ko commented Nov 27, 2024

Hello, could you try again on v1.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants