Appium device session not dropping

I create a connection for a device, then when I finish working with the device and log out, the session does not delete the devices and the device still remains busy. Can you help me?

All log :

[device-farm-main] Unable to unblock device. Reason: Error: EACCES: permission denied, open ‘/Users/qaautomation/.cache/appium-device-farm/storage/a390d0ed64ca0a1df7f5e2638794140e’

[device-farm-main] :iphone: Unblocking the device that is blocked for session 4f3684b9-908d-4d98-b711-081774ad6cef

[AppiumDriver@ecee] Executing default handling behavior for command ‘deleteSession’

[AppiumDriver@ecee] Event ‘quitSessionRequested’ logged at 1713524127783 (13:55:27 GMT+0300 (GMT+03:00))

[AppiumDriver@ecee] Removing session 4f3684b9-908d-4d98-b711-081774ad6cef from our master session list

[XCUITestDriver@4bf0 (4f3684b9)] Matched ‘/session/4f3684b9-908d-4d98-b711-081774ad6cef’ to command name ‘deleteSession’

[XCUITestDriver@4bf0 (4f3684b9)] Proxying [DELETE /session/4f3684b9-908d-4d98-b711-081774ad6cef] to [DELETE http://127.0.0.1:49345/session/81992E04-B57B-4B1C-9FEF-404FEAA94007] with no body

[XCUITestDriver@4bf0 (4f3684b9)] Got response with status 200: {“value”:null,“sessionId”:null}

[DevCon Factory] Releasing connections for 00008030-000425EC1E04802E device on any port number

[DevCon Factory] Found cached connections to release: [“00008030-000425EC1E04802E:49345”]

[DevCon Factory] Releasing the listener for ‘00008030-000425EC1E04802E:49345’

[iProxy@00008030:49345] Closing the connection

[DevCon Factory] Cached connections count: 0

[XCUITestDriver@4bf0 (4f3684b9)] Not clearing log files. Use clearSystemFiles capability to turn on.

[AppiumDriver@ecee] Event ‘quitSessionFinished’ logged at 1713524127792 (13:55:27 GMT+0300 (GMT+03:00))

[AppiumDriver@ecee] Received response: null

[AppiumDriver@ecee] But deleting session, so not returning

[AppiumDriver@ecee] Responding to client with driver.deleteSession() result: null

[HTTP] ← DELETE /wd/hub/session/4f3684b9-908d-4d98-b711-081774ad6cef 200 12 ms - 14

[HTTP]

[HTTP] → GET /wd/hub/sessions

[HTTP] {}

[AppiumDriver@ecee] Calling AppiumDriver.getSessions() with args:

[device-farm-main] :iphone: Plugin Args: {“androidDeviceType”:“both”,“iosDeviceType”:“both”}

[AppiumDriver@ecee] Plugins which can handle cmd ‘getSessions’: device-farm

[AppiumDriver@ecee] Plugin device-farm is now handling cmd ‘getSessions’

[AppiumDriver@ecee] Executing default handling behavior for command ‘getSessions’

[AppiumDriver@ecee] Responding to client with driver.getSessions() result:

[HTTP] ← GET /wd/hub/sessions 304 1 ms - -

[HTTP]

[device-farm-main] Found 1 device candidates to be released

[device-farm-main] Cleaning pending sessions…

[device-farm-main] No pending sessions to clean

[iProxy@00008030:49345] The connection has been closed

Second Log :

[AppiumDriver@0031] Command ‘deleteSession’ was not handled by the following behaviours or plugins, even though they were registered to handle it: [“default”,“device-farm”]. The command was handled by these: [“appium-dashboard”].

[XCUITestDriver@d2c6 (725ca7b2)] Encountered internal error running command: SQLITE_READONLY: attempt to write a readonly database

[XCUITestDriver@d2c6 (725ca7b2)] Error:

[XCUITestDriver@d2c6 (725ca7b2)] at Database. (/Users/qaautomation/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/sqlite/query.js:236:27)

[XCUITestDriver@d2c6 (725ca7b2)] at /Users/qaautomation/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/sqlite/query.js:234:50

[XCUITestDriver@d2c6 (725ca7b2)] at new Promise ()

[XCUITestDriver@d2c6 (725ca7b2)] at Query.run (/Users/qaautomation/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/sqlite/query.js:234:12)

[XCUITestDriver@d2c6 (725ca7b2)] at /Users/qaautomation/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/sequelize.js:650:28

[XCUITestDriver@d2c6 (725ca7b2)] at SQLiteQueryInterface.bulkUpdate (/Users/qaautomation/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/dialects/abstract/query-interface.js:930:12)

[XCUITestDriver@d2c6 (725ca7b2)] at Function.update (/Users/qaautomation/.appium/node_modules/appium-dashboard/node_modules/sequelize/src/model.js:3352:28)

[HTTP] ← DELETE /wd/hub/session/725ca7b2-9ce4-488e-b216-21559120b774 500 44 ms - 606

[HTTP]

[HTTP] → GET /wd/hub/sessions

[HTTP] {}

[AppiumDriver@0031] Calling AppiumDriver.getSessions() with args:

[device-farm-main] :iphone: Plugin Args: {“androidDeviceType”:“both”,“iosDeviceType”:“both”}

[AppiumDriver@0031] Plugins which can handle cmd ‘getSessions’: device-farm,appium-dashboard

[AppiumDriver@0031] Plugin appium-dashboard is now handling cmd ‘getSessions’

[AppiumDriver@0031] Plugin device-farm is now handling cmd ‘getSessions’

[AppiumDriver@0031] Executing default handling behavior for command ‘getSessions’

[AppiumDriver@0031] Responding to client with driver.getSessions() result: [{“id”:“725ca7b2-9ce4-488e-b216-21559120b774”,“capabilities”:{“platformName”:“ios”,“appiumVersion”:“1.22.2”,“automationName”:“XCUITest”,“includeSafariInWebviews”:true,“newCommandTimeout”:3600,“connectHardwareKeyboard”:true,“clearDeviceLogsOnStart”:true,“nativeWebScreenshot”:true,“udid”:“BAC01610-8C72-41D5-A7B8-B4EAE7DC04EE”,“deviceName”:“iPhone 15 Pro”,“platformVersion”:“17.2”,“wdaLocalPort”:49538,“mjpegServerPort”:49539,“derivedDataPath”:“/Users/qaautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-BAC01610-8C72-41D5-A7B8-B4EAE7DC04EE”}}]

[HTTP] ← GET /wd/hub/sessions 200 3 ms - 565

[HTTP]

[HTTP] → GET /dashboard/api/sessions

[HTTP] {}

[device-farm-main] Received non-webdriver request with url /dashboard/api/sessions. So, not proxying it to downstream.

[HTTP] → GET /device-farm/api/device

[HTTP] {}

[device-farm-main] Received non-webdriver request with url /device-farm/api/device. So, not proxying it to downstream.

[HTTP] ← GET /dashboard/api/sessions 304 4 ms - -

[HTTP]

[HTTP] → GET /dashboard/api/sessions?start_time=2024-04-19T11:24:51.471Z

[HTTP] {}

[device-farm-main] Received non-webdriver request with url /dashboard/api/sessions. So, not proxying it to downstream.

[HTTP] ← GET /dashboard/api/sessions?start_time=2024-04-19T11:24:51.471Z 200 4 ms - 47

[HTTP]

[HTTP] ← GET /device-farm/api/device 200 8 ms - 15368

[HTTP]

[HTTP] → GET /device-farm/api/queue/length

[HTTP] {}

[device-farm-main] Received non-webdriver request with url /device-farm/api/queue/length. So, not proxying it to downstream.

[HTTP] ← GET /device-farm/api/queue/length 304 1 ms - -

[HTTP]

[device-farm-main] Found 1 device candidates to be released

[device-farm-main] Cleaning pending sessions…

[device-farm-main] No pending sessions to clean

[HTTP] → GET /device-farm/api/device

[HTTP] {}

[device-farm-main] Received non-webdriver request with url /device-farm/api/device. So, not proxying it to downstream.

[HTTP] → GET /dashboard/api/sessions

[HTTP] {}

[device-farm-main] Received non-webdriver request with url /dashboard/api/sessions. So, not proxying it to downstream.

[HTTP] → GET /dashboard/api/sessions?start_time=2024-04-19T11:24:51.471Z

[HTTP] {}

[device-farm-main] Received non-webdriver request with url /dashboard/api/sessions. So, not proxying it to downstream.

[HTTP] ← GET /dashboard/api/sessions 304 4 ms - -

[HTTP]

[HTTP] ← GET /dashboard/api/sessions?start_time=2024-04-19T11:24:51.471Z 200 4 ms - 47

[HTTP]

[HTTP] ← GET /device-farm/api/device 304 9 ms - -

[HTTP]

[HTTP] → GET /device-farm/api/queue/length

[HTTP] {}

You should probably report this issue to the appropriate plugin issues tracker