AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
335 stars 102 forks source link

Getting /.cache/appium-device-farm/storage/10337678c7103dd8d7a804e01f7589cd does not look like a valid storage file! error and because of this session is getting created. #619

Closed kuldeep04 closed 1 year ago

kuldeep04 commented 1 year ago

Discussed in https://github.com/AppiumTestDistribution/appium-device-farm/discussions/618

Originally posted by **kuldeep04** January 25, 2023 Appium log: ``` Error: [node-persist][readFile] /.cache/appium-device-farm/storage/10337678c7103dd8d7a804e01f7589cd does not look like a valid storage file! at /.appium/node_modules/appium-device-farm/node_modules/node-persist/src/local-storage.js:314:89 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) ```
saikrishna321 commented 1 year ago

@kuldeep04 Can you please post the content of this file /.cache/appium-device-farm/storage/10337678c7103dd8d7a804e01f7589cd

kuldeep04 commented 1 year ago

@saikrishna321 file name is something like this: 10337678c7103dd8d7a804e01f7589cd and file is empty.

saikrishna321 commented 1 year ago

@kuldeep04 So is this happening consistently ?

kuldeep04 commented 1 year ago

@saikrishna321 its happening consistently.

Steps:

  1. Run test on iOS device. 2.test will run with he newly created appium session but
  2. when I trying to create another (new session) then session is not getting created.

Attaching log.

[Appium] Could not configure Appium server. It's possible that a driver or plugin tried to update the server and failed. Original error: [node-persist][readFile] /Users/kuldeep.yadav/.cache/appium-device-farm/storage/10337678c7103dd8d7a804e01f7589cd does no[t look like a valid storage file!
debug] [Appium] Error: [node-persist][readFile] /Users/kuldeep.yadav/.cache/appium-device-farm/storage/10337678c7103dd8d7a804e01f7589cd does not look like a valid storage file!
[debug] [Appium]     at /Users/kuldeep.yadav/.appium/node_modules/appium-device-farm/node_modules/node-persist/src/local-storage.js:314:89
[debug] [Appium]     at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
saikrishna321 commented 1 year ago

@kuldeep04 when I trying to create another (new session) then session is not getting created Meaning second test is starting to run?

Before running the second the session can you check in storage folder if the file has any content?

kuldeep04 commented 1 year ago

@saikrishna321 means appium server is not getting started for second run, and after deleting the file inside /.cache/appium-device-farm/storage this folder appium server is working fine.

Before running the second the session can you check in storage folder if the file has any content? - No

saikrishna321 commented 1 year ago

@kuldeep04 Share full logs when this issue happens again.

Dileep17 commented 1 year ago

@saikrishna321 as discussed this issue started with local persist. check https://github.com/AppiumTestDistribution/appium-device-farm/pull/645 and merge the temp fix.

duchu commented 1 year ago

In version 7.4.0+ this error still occurs, are there any other ways to solve this problem?