error purging survey data

Does it actually work when you try to access via Dropbear:

# then enter

It will ask you to accept the host key, since Dropbear supports the modern Ed25519 key format while libssh2 (used by curl) supports only RSA. After entering the password it will exit immediately as only SFTP is supported:

This service allows sftp connections only.

But if you get so far, at least we know that generally SSH communication and authentication from you system works, so it then must be something about curl/libssh2.

Can you also show the output of these commands:

uname -a
apt policy curl libssh2-1

I use openSSH and not dropbear, is that a problem?

Here is the output of the last command:

RPi 3 Model B+ (aarch64)
Linux DietPi 5.10.60-v8+ #1449 SMP PREEMPT Wed Aug 25 15:01:33 BST 2021 aarch64 GNU/Linux
  Installiert:           7.74.0-1.3+deb11u1
  Installationskandidat: 7.74.0-1.3+deb11u1
 *** 7.74.0-1.3+deb11u1 500
        500 bullseye/main arm64 Packages
        100 /var/lib/dpkg/status
  Installiert:           1.9.0-2
  Installationskandidat: 1.9.0-2
 *** 1.9.0-2 500
        500 bullseye/main arm64 Packages
        100 /var/lib/dpkg/status

And here is the output of the command:


Warning: Permanently added the RSA host key for IP address '2a06:1c40:3::142' to the list of known hosts.'s password:
Connected to

interesting, the IPv6 address of has been added to know hosts

;; ANSWER SECTION:         300     IN      AAAA    2a06:1c40:3::142

IP address '2a06:1c40:3::142' to the list of known hosts.

Can you try agin

> "$G_HW_UUID.txt"
curl --verbose --key '' -m 20 -T "$G_HW_UUID.txt" "s$G_HW_UUID.txt"
root@DietPi:~# > "$G_HW_UUID.txt"
curl --verbose --key '' -m 20 -T "$G_HW_UUID.txt" "sftp://dietpi-survey:upload2d                                                                                                                                                   $G_HW_UUID.txt"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*                                                                                                                                                                Trying 2a06:1c40:3::142:22...
* Connected to (2a06:1c40:3::142) port 22 (#0)
* Found host in /root/.ssh/known_hosts
* Set "ecdsa-sha2-nistp256" as SSH hostkey type
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (79) Error in the SSH layer

Strange, there was another report about this SSH layer error and we couldn’t find any reason or solution for it. I’m puzzled since it works for everyone else and the package/build of all underlying libraries and commands are the same.

Not sure whether the known_hosts entry autogenerated like that may cause the issue. Generally our images ship with our host key added, here how to recreate it:
If you have other known hosts in that file, please add the line manually as the given command was to recreate the file, which was missing competely for that user.

Wow… I renamed the existing known_hosts file and created a new one with your command and suddenly sending the survey data works… Well, thanks for your help!

hmm probably the host file got corrupted?

Wow, I’m somehow surprised as well. The error message was so absolutely not pointing into that direction, also the output Found host in /root/.ssh/known_hosts looks like it is all fine.

Only now I see that Set “ecdsa-sha2-nistp256” as SSH hostkey type actually refers to a wrong host key type, since the stored one is an RSA host key. On a successful upload it shows hence Set “ssh-rsa” as SSH hostkey type. Still, I’d have expected an error message then that the SSH host key retrieved from the server does not match known host key :thinking:.

However, great that it finally works now. Looks like we need to keep in mind the known_hosts recreation as a generic solution for survey issues :sunglasses:.