# Mavsdk ftp list fails "Unknown error code: 3"

**URL:** <https://discuss.px4.io/t/mavsdk-ftp-list-fails-unknown-error-code-3/39398>\
**Category:** MAVSDK\
**Created:** [June 24, 2024, 2:53pm UTC](https://discuss.px4.io/t/mavsdk-ftp-list-fails-unknown-error-code-3/39398 "2024-06-24T14:53:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curious\_Jackal](https://discuss.px4.io/user_avatar/discuss.px4.io/curious_jackal/32/14731_2.png) [@Curious\_Jackal](https://discuss.px4.io/u/Curious_Jackal)\
**Post date:** [June 24, 2024, 2:53pm UTC](https://discuss.px4.io/t/mavsdk-ftp-list-fails-unknown-error-code-3/39398/1 "2024-06-24T14:53:55Z")

</div>

I’m trying to list the files on the FCU like Mission Planner does under config → MAVFtp.

I’m running Mission Planner with a Copter simulation and also running `mavsdk_server` inside a docker container:

```auto
/usr/local/lib/python3.10/dist-packages/mavsdk/bin/mavsdk_server "tcp://host.docker.internal:5762"

[02:41:34|Info] MAVSDK version: v2.12.0 (mavsdk_impl.cpp:26)
[02:41:34|Info] Waiting to discover system on tcp://host.docker.internal:5762... (connection_initiator.h:20)
[02:41:34|Debug] New system ID: 1 Comp ID: 1 (mavsdk_impl.cpp:720)
[02:41:34|Debug] Component Autopilot (1) added. (system_impl.cpp:366)
[02:41:34|Warn] Vehicle type changed (new type: 2, old type: 0) (system_impl.cpp:217)
[02:41:34|Debug] Discovered 1 component(s) (system_impl.cpp:509)
[02:41:34|Info] System discovered (connection_initiator.h:62)
[02:41:34|Info] Server started (grpc_server.cpp:169)
[02:41:34|Info] Server set to listen on 0.0.0.0:50051 (grpc_server.cpp:170)

```

Then, using the [sample code](https://github.com/mavlink/MAVSDK-Python/blob/02c8dced71c436e897920a3fe28b08ce344b1e48/examples/ftp_list_dir.py), I get the following error:

```auto
$ ./ftp_list_dir.py

connecting to mavsdk server...
Waiting for drone to connect...
-- Connected to drone!
[02:50:37|Info] Unknown error code: 3 (mavlink_ftp_client.cpp:1068)
Traceback (most recent call last):
  File "/xxxxx/./ftp_list_dir.py", line 24, in <module>
    asyncio.run(run())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/xxxxx/./ftp_list_dir.py", line 19, in run
    print("directory list", await drone.ftp.list_directory("/"))
  File "/usr/local/lib/python3.10/dist-packages/mavsdk/ftp.py", line 449, in list_directory
    raise FtpError(result, "list_directory()", remote_dir)
mavsdk.ftp.FtpError: PROTOCOL_ERROR: 'Protocol Error'; origin: list_directory(); params: ('/',)
Exception ignored in: <function System. __del__ at 0x7f0068bba0e0>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/mavsdk/system.py", line 88, in __del__
  File "/usr/local/lib/python3.10/dist-packages/mavsdk/system.py", line 124, in _stop_mavsdk_server
ImportError: sys.meta_path is None, Python is likely shutting down

```

Needless to say, the Mission Planner MavFtp UI works well and is able to list the FCU files.

Any idea why the list fails?
