Test fails due to wrong session id (Jenkins run)

happens when I run a test suite in jenkins

it looks like appium is searching for element but it’s sending the id of the previous session instead of the current one to the server,

how can I fix this?

running appium on mac with ruby

log:

2018-02-20 21:07:21:791 - info: [debug] [BaseDriver] Waiting up to 0 ms for condition
2018-02-20 21:07:21:791 - info: [debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/95B1E2A9-E162-49E0-995D-B9038D4A0F94/element] with body: {“using”:“id”,“value”:“login_with_email_button”}
2018-02-20 21:07:21:797 - info: [debug] [JSONWP Proxy] Got response with status 200: {“value”:“Session does not exist”,“sessionId”:“BA9D733C-2FA2-4828-B8C2-22AC229F9DA9”,“status”:6}
2018-02-20 21:07:21:800 - info: [HTTP] <-- POST /wd/hub/session/df6002bb-4510-44a5-be88-8dc0c51c2c5a/element 500 10 ms - 164