Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup should delete warp client #122

Closed
jychp opened this issue Nov 27, 2024 · 6 comments
Closed

Cleanup should delete warp client #122

jychp opened this issue Nov 27, 2024 · 6 comments

Comments

@jychp
Copy link

jychp commented Nov 27, 2024

It could be great if cleanup action can purge the warp client and not just delete the mdm file.

@F21
Copy link
Member

F21 commented Nov 27, 2024

Can you elaborate further on why you need this? We delete the mdm file to disconnect the client from Zero Trust. Shortly after, the VM gets destroyed, so uninstalling the client seems to be unnecessary.

@ehartmann
Copy link
Contributor

Hi @F21 ,

We are using this GitHub actions on self hosted runners (linux ones), and we observed that mdm.xml file is not deleted and the second run on the self hosted runner is failing during Setup Cloudflare Warp with the following error :

....
(local policy)	Auth Client ID: ***
(not set)	Allow Updates: true
(local policy)	Allowed to Leave Org: false
(local policy)	MDM Configuration: <single-config>
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
/usr/bin/warp-cli --accept-tos connect
Success
/usr/bin/warp-cli --accept-tos status
Status update: Unable
Reason: Registration Missing
Error: WARP is not connected

@F21
Copy link
Member

F21 commented Dec 12, 2024

Does it connect during the first run? The Registration Missing error seems to be related to permissions: https://github.com/Boostport/setup-cloudflare-warp?tab=readme-ov-file#cloudflare-permissions

@ehartmann
Copy link
Contributor

Thanks @F21 , the token is correct, the issue is intermittent.

I think we've found an issue when the action's setup fails (in our case when mdm.xml is still present).

Sorry for this big image:
Image

As you can see on the post action is triggering the same commands as the ones in "Setup Cloudflare Warp".
If my understanding is correct, I think it's because the exception is caught by index.js this line is not executed: https://github.com/Boostport/setup-cloudflare-warp/blob/main/index.js#L11C8-L11C40

So the second call triggers the same sequence as "Setup Cloudflare Warp".

I'm wondering if the mdm.xml should not also be deleted during the Setup before, I'm unsure if warp-svc systemd unit should not be restarted when mdm.xml is deleted.

@F21
Copy link
Member

F21 commented Dec 14, 2024

For the Post Setup Cloudflare Warp bug, I think we should move core.saveState("isPost", "true"); outside the try ... catch. Can you open a PR for this?

Regarding the Registration Missing error, it's always been interminent when I encountered it in the past and I think it's more likely an issue with Cloudflare rather than the action.

@ehartmann
Copy link
Contributor

Yes I'll open a PR for fixing the issue on "Post Setup Cloudflare Warp". And I agree with you the issue on Registration missing is not related to this action.

ehartmann added a commit to ehartmann/setup-cloudflare-warp that referenced this issue Dec 16, 2024
Ensure that post condition is set even if there is an exception
ehartmann added a commit to ehartmann/setup-cloudflare-warp that referenced this issue Dec 16, 2024
@F21 F21 closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants