[NETCONF-688] NetConf callhome server reports Created: 19/May/20  Updated: 20/May/20  Resolved: 20/May/20

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Martin Skorupski Assignee: Jamo Luhrsen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Karaf:INFO

Karaf
 Karaf version 4.2.6
 Karaf home /opt/opendaylight
 Karaf base /opt/opendaylight
 OSGi Framework org.eclipse.osgi-3.12.100.v20180210-1608

JVM
 Java Virtual Machine OpenJDK 64-Bit Server VM version 11.0.7+10
 Version 11.0.7
 Vendor AdoptOpenJDK
 Pid 58
 Uptime 44 minutes
 Process CPU time 2 minutes
 Process CPU load 0.00
 System CPU load 0.02
 Open file descriptors 409
 Max file descriptors 1,048,576
 Total compile time 1 minute
Threads
 Live threads 126
 Daemon threads 53
 Peak 138
 Total started 509
Memory
 Current heap size 175,775 kbytes
 Maximum heap size 2,097,152 kbytes
 Committed heap size 425,984 kbytes
 Pending objects 0
 Garbage collector Name = 'G1 Young Generation', Collections = 38, Time = 0.941 seconds
 Garbage collector Name = 'G1 Old Generation', Collections = 0, Time = 0.000 seconds
Classes
 Current classes loaded 24,255
 Total classes loaded 24,834
 Total classes unloaded 579
Operating system
 Name Linux version 5.3.0-51-generic
 Architecture amd64
 Processors 6

Attachments: Text File karaf-log.partly.txt    

 Description   

When configuring NetconfCallhomeServer with a new allowed device, the following error is shown in karaf.log:

´´´

2020-05-19T12:49:44,966 | ERROR | opendaylight-cluster-data-notification-dispatcher-36 | DataTreeChangeListenerActor | 223 - org.opendaylight.controller.sal-clustering-commons - 1.11.0 | member-1-shard-default-config: Error notifying listener org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataTreeChangeListenerAdapter@4086184e
java.lang.StringIndexOutOfBoundsException: offset 4, count 813826314, length 270

´´´´

Please see attached file, which contains the related RestConf (bierman) PUT command.

It can be reproduced for Soduim-SR1 and Magnesium-SR0.

 

HTTP PUT:  /restconf/config/odl-netconf-callhome-server:netconf-callhome-server

{
 "odl-netconf-callhome-server:netconf-callhome-server": {
 "odl-netconf-callhome-server:allowed-devices": {
 "odl-netconf-callhome-server:device": [
  {
    "odl-netconf-callhome-server:unique-id": "NTS_Manager",
    "odl-netconf-callhome-server:ssh-host-key": "MIIBCgKCAQEAuaf1++Z3N9H17X893pI1pGpXdUOJuOPuFnoZFyjPTY3pqedNpEbvz24SkMynogipxbOc+9iBRtkZda00bLtU1KtJ3r8qy5zkjttZ9YN4kN4qTVTQH/2kKp5CAjyWF4uMNiSiYH3600lgsnTfgOAGp9wevN9JzQs+kp1BzfMO8YF/wZqSjGfcasKHza0OITE92JfIUuiDqki4LVbo+fJogrWWshACg3EweatAfBmblWO2nluF6akRu7hOl2iB8dIrba7UjnTj8R2BP7vYclDn7QUlFzVjoN5bWp1eJOP60ZX/NcnSo7ibPmyc7W8JCluKnNPM1wuVuP/mtYNjqsVqbwIDAQAB",
    "odl-netconf-callhome-server:credentials": {
      "odl-netconf-callhome-server:username": "netconf",
      "odl-netconf-callhome-server:passwords": [
         "netconf"
          ]
         }
       }
     ]
    }
  }
}

The RestConf response is 201, however the callhome function later reports errors during ssh key exchange.

Is there something wrong with the json-body?

 

 



 Comments   
Comment by Jamo Luhrsen [ 19/May/20 ]

demx8as6, is that ssh key ok? It looks short compared to one I have in a postman collection:

{
  "device": {
    "unique-id": "December_19_Demo_Device",
    "ssh-host-key": "AAAAB3NzaC1yc2EAAAADAQABAAABAQChcF3lc/sHHv+P8fV0X4OKIZvaoQWxjeM+OgLykzuMfisww3+i/9PNb5vWsatftbt7wZKtV9jj0A4mN61thCvt+e7to3Nh93tRgV1XHIUHdbnRoL/8SjHo6NnO+HdF7eiVr4fOXfQpeTiaQ1ghscLFkcGg+olFmBCKGPKBz3oogFZ12ze5KIJQYmOBNI1T/iM4tSRg2ShSB2Sw4A/kduZV7kHo4bnVqsfsZZHLoAojktR174H/mOpGaRd0JvucQPrmc9FP64YyHjHGfU7Y1KaTAALwRQ4zTWl2nRD/io/8/8z96c0ClKTuWukCmaJyuSbaJD0SSSlj9M1EXWw04QLP"
  }
}

Not that the Error in the karaf.log is helpful.

Comment by Alex Stancu [ 20/May/20 ]

It seems that the host key that you are trying to provide is in PEM format, and ODL expects it in an "ssh format".

You can get the public key in a format usable in SSH with this command, in Linux:

ssh-keygen -y -f private-key.pem > public-key.pub

I've tried to configure ODL with this new key and the error is not there anymore.

Comment by Martin Skorupski [ 20/May/20 ]

jluhrsen, thanks for asking the right questions!

alex.stancu Thanks for pointing to the different public-key formats!

All good -> closed

Comment by Martin Skorupski [ 20/May/20 ]

Based on the explainaitions the issue can be considered as "invalid"

Generated at Wed Feb 07 20:15:39 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.