Unable to deploy to phone: 'Xperia XA2 WIFI - Dual SIM (ARM)' is not a known device

I have installed SDK 3.2 , (docker)

I have added the phone to devices, and it passes the “Test” button to connect.
Trying to run I get:

C:/l/SailfishOS/bin/./sfdk.exe -c target=SailfishOS-3.4.0.22EA-armv7hl -c ‘device=Xperia XA2 WIFI - Dual SIM (ARM)’ deploy --sdk
Not running under MSYS shell. Session management is not possible.
Fatal: ‘Xperia XA2 WIFI - Dual SIM (ARM)’ is not a known device
13:28:16: The process “C:\l\SailfishOS\settings\SailfishSDK\libsfdk\build-target-tools\sailfish-os-build-engine\SailfishOS-3.4.0.22EA-armv7hl\deploy.cmd” exited with code 1.
Error while building/deploying project componentgallery (kit: SailfishOS-3.4.0.22EA-armv7hl (in sailfish-os-build-engine))
When executing step “RPM”

Could you please show us the content of your C:/l/SailfishOS/vmshare/devices.xml file?

<?xml version="1.0" encoding="UTF-8"?>
<devices>
    <host name="NewUser-PC"/>
    <engine name="sailfish-os-build-engine" type="vbox">
        <subnet>10.220.220</subnet>
    </engine>
    <device name="Sailfish OS Emulator 3.3.0.16" type="vbox">
        <index>1</index>
        <subnet>10.220.220</subnet>
        <sshkeypath>ssh/private_keys/Sailfish_OS-Emulator-latest</sshkeypath>
        <mac>08:00:5A:11:00:01</mac>
        <username>nemo</username>
    </device>
</devices>

This is strange - it should have an entry for your device but it doesn’t. At the moment I have no idea what might be causing that.

Could you try adding the device again in Qt Creator?

I edited in the missing device from the previous sdk directory.
When I did “run” I go this:

18:13:20: Test Device Connection: Testing connection to "Xperia XA2 WIFI - Dual SIM (ARM)"...

Error while building/deploying project componentgallery (kit: SailfishOS-3.4.0.22EA-armv7hl (in sailfish-os-build-engine))

When executing step "Prepare Target"

18:13:30: Elapsed time: 00:47.

The second time I ran it, it has reverted to not a known device.

That means that the connection test failed. It’s a bit unfortunate that it doesn’t tell us why the connection failed. But in any case, I recommend that you remove and add the device again inside Qt Creator, as that should regenerate all configuration files etc.

OK, so I removed and recreated it. This time:

ssh: connect to host 192.168.1.74 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.3]

Now it passes test button on options->device, as below. But since it says "SFTP will be used (below), why is it trying rsync (above)

Checking whether rsync works...
Failed to start rsync: Process failed to start: The system cannot find the file specified.

SFTP will be used for deployment, because rsync is not available.

Device test finished successfully.

The “SFTP will be used…” text comes from Qt Creators remote linux tester, which we use in configuration wizard. That should really never happen, as rsync should get installed at the latest when you add the device - just before the connection test is run.

Which Sailfish OS version is installed on your device?

version 3.4.0.24

text comes from Qt Creators remote linux tester, which we use in configuration wizard.

yes, the test button is obviously also that.

If you ssh to your device, and execute rsync does it run?

yes rsync works when I direct ssh.
(I have left ssh running while I try to deploy, and it is still active when delpoy attempt is done.)
Perhaps something to do with keys. Authentication type is “Specific Key” C:\Users\New User.ssh\qtc_id (The key file and the device xml is the same as it was in previous sdk version that was working.)
ok, so now I tried to ssh in using the key file and it works, so that key file is working.:

C:\Users\New User>ssh -i .ssh\qtc_id nemo@192.168.1.74

note the error message (below) was ssh connection refused (below)
also note “Skipping disabled step Prepare Target”

21:12:06: Skipping disabled step Prepare Target.
21:12:06: Deploying RPM package...
21:12:06: Starting: "C:\l\SailfishOS\settings\SailfishSDK\libsfdk\build-target-tools\sailfish-os-build-engine\SailfishOS-3.4.0.22EA-armv7hl\deploy.cmd" --sdk
+ C:/l/SailfishOS/bin/./sfdk.exe -c target=SailfishOS-3.4.0.22EA-armv7hl -c 'device=Xperia XA2 - Dual SIM (ARM)' deploy --sdk
Not running under MSYS shell. Session management is not possible.
No journal files were found.
Building target platforms: armv7hl-meego-linux
Building for target armv7hl-meego-linux
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.a1lIfu
+ umask 022
+ cd C:/l/sfos/build-componentgallery-SailfishOS_3_4_0_22EA_armv7hl_in_sailfish_os_build_engine-Debug
+ '[' /home/deploy/installroot '!=' / ']'
+ rm -rf /home/deploy/installroot
++ dirname /home/deploy/installroot
+ mkdir -p /home/deploy
+ mkdir /home/deploy/installroot
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /home/deploy/installroot
+ export QT_SELECT=5
+ QT_SELECT=5
+ make install INSTALL_ROOT=/home/deploy/installroot INSTALL_LIBDIR=/home/deploy/installroot//usr/lib
cp -f -R C:/l/sfos/componentgallery/qml /home/deploy/installroot/usr/share/componentgallery/
install -m 755 -p componentgallery /home/deploy/installroot/usr/bin/componentgallery
install -m 644 -p C:/l/sfos/componentgallery/componentgallery.desktop /home/deploy/installroot/usr/share/applications/
+ desktop-file-install --delete-original --dir /home/deploy/installroot/usr/share/applications /home/deploy/installroot/usr/share/applications/componentgallery.desktop
+ /usr/lib/rpm/find-debuginfo.sh -j4 --strict-build-id --build-id-seed 0.4-1 --unique-debug-suffix -0.4-1.arm --unique-debug-src-base componentgallery-0.4-1.arm -S debugsourcefiles.list C:/l/sfos/build-componentgallery-SailfishOS_3_4_0_22EA_armv7hl_in_sailfish_os_build_engine-Debug/
extracting debug info from /home/deploy/installroot/usr/bin/componentgallery
1 blocks
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/meego/brp-compress
+ /usr/lib/rpm/meego/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/meego/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/meego/find-docs.sh /home/deploy/installroot
Processing files: componentgallery-0.4-1.armv7hl
+ /usr/lib/rpm/meego/brp-java-repack-jars
Provides: application() application(componentgallery.desktop) componentgallery = 0.4-1 componentgallery(armv7hl-32) = 0.4-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: libQt5Qml.so.5 libQt5Qml.so.5(Qt_5) libc.so.6 libc.so.6(GLIBC_2.4) libgcc_s.so.1 libgcc_s.so.1(GCC_3.5) libsailfishapp.so.1
Processing files: componentgallery-debuginfo-0.4-1.armv7hl
Provides: componentgallery-debuginfo = 0.4-1 componentgallery-debuginfo(armv7hl-32) = 0.4-1 debuginfo(build-id) = 15afa4b18fd496d18f15d7932c2295b0ea2fbb2d
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Recommends: componentgallery-debugsource(armv7hl-32) = 0.4-1
Processing files: componentgallery-debugsource-0.4-1.armv7hl
Provides: componentgallery-debugsource = 0.4-1 componentgallery-debugsource(armv7hl-32) = 0.4-1
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/deploy/installroot
Wrote: C:/l/sfos/build-componentgallery-SailfishOS_3_4_0_22EA_armv7hl_in_sailfish_os_build_engine-Debug/RPMS/componentgallery-0.4-1.armv7hl.rpm
Wrote: C:/l/sfos/build-componentgallery-SailfishOS_3_4_0_22EA_armv7hl_in_sailfish_os_build_engine-Debug/RPMS/componentgallery-debuginfo-0.4-1.armv7hl.rpm
Wrote: C:/l/sfos/build-componentgallery-SailfishOS_3_4_0_22EA_armv7hl_in_sailfish_os_build_engine-Debug/RPMS/componentgallery-debugsource-0.4-1.armv7hl.rpm
ssh: connect to host 192.168.1.74 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.3]

For some reason your build engine is not able to connect to the device.

Debugging this kind of errors is really hard without physical access to the machine in question :frowning:

I know it’s not as convenient, but I hope you can still use the “Build RPM Package For Manual Deployment” method and deploy your app manually,

Indeed.
It seems the issue is that merssh can’t connect. Perhaps it’s to do with the key file

merssh looks rather specialised. It must access the devices.xml to get the key file, as it doesn’t appear on the commandline

Is deploy.cmd being run in actual windows, or is it being run inside a docker container? If so could the docker container be blocking network access?

I was running this 6 months ago, but virtualbox not docker.

Nope. merssh is used for connections between Qt Creator and the build engine. Deploying is done with “normal” ssh from inside the build engine.

I don’t think so - the error message would be something else than “connection refused”.

That’s my feeling as well, as the connection test from Qt Creator seems to pass. But that would not explain the “Failed to start rsync” issue…

1 Like

perhaps this is just what rsync says when ssh connection is refused

rsync: connection unexpectedly closed

In Docker settings I tried to add:

Bypass proxy settings for these hosts & domains
192.168.1.74

no effect

Also:

Configure the way Docker containers interact with the network

Docker subnet
192.168.65.0/28

Not really sure if it’s the same case or just slightly related but I also had issues when I tried to build app and deploy it to my device a few days ago. In my case the main reason was some mess up with the keys. First I re-added the device and then I had to add my computer’s public keys to my device’s .ssh/authorized_keys file. After this deploying went smoothly.

I think that is working because I can manually ssh with the key file thus

C:\Users\New User>ssh -i .ssh\qtc_id nemo@192.168.1.74

I can’t see for sure what commandline is being passed to ssh when it fails though - I just assume it is being passed the right key file.

“Fatal: ‘Xperia X Compact (ARM)’ is not a known device”
I seem to have the same problem. The device I’ve just created is not listed in vmshare/devices.xml

It’s related to SSH keys. My normal key is on the device, so I didn’t create a new one for the failed config. If I create another config with a dedicated key and deploy the public key to the device it works as expected…

Where is your new key located?

Interestingly it refuses to make a new key since there is an old one. I will try removing the old one (at the pc)

I wonder if there is any limit on the scope that docker has access to i.e. the docker part can’t see the key as it is out of scope (I know nothing about docker)