saitho / hetzner-cloud-action

6 stars 0 forks source link

Debug code at crashes action #22

Open DavyLandman opened 2 years ago

DavyLandman commented 2 years ago

I'm getting this all the time, I'm thinking some change in the hetzner API that the code is hitting?

Run saitho/hetzner-cloud-action@master
  with:
    action: create
    server_name: run-backup
    server_image: debian-11
    server_type: cx21
    server_location: fsn1
    server_ssh_key_name: github-ci
    wait_for_ssh: 1
  env:
    API_TOKEN: ***
(node:1510) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:1510) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TLSSocket'
    |     property 'parser' -> object with constructor 'HTTPParser'
    --- property 'socket' closes the circle
    at JSON.stringify (<anonymous>)
    at toCommandValue (/home/runner/work/_actions/saitho/hetzner-cloud-action/master/dist/index.js:3556:17)
    at escapeData (/home/runner/work/_actions/saitho/hetzner-cloud-action/master/dist/index.js:3560:12)
    at Command.toString (/home/runner/work/_actions/saitho/hetzner-cloud-action/master/dist/index.js:3541:35)
    at Object.issueCommand (/home/runner/work/_actions/saitho/hetzner-cloud-action/master/dist/index.js:3504:30)
    at Object.debug (/home/runner/work/_actions/saitho/hetzner-cloud-action/master/dist/index.js:3869:15)
    at /home/runner/work/_actions/saitho/hetzner-cloud-action/master/dist/index.js:2695:12
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

If I read this correctly, the Object.debug function is causing the code to crash, without a message on what is happening.

saitho commented 2 years ago

Hi there,

I've been trying to examine this for a couple weeks now at #23, but I keep running into other issues.

While the action fails with a timeout, the server is actually being created successfully. No idea where that's coming from. Running the script without the GitHub action works fine. Seems to be an issue with GItHub actions then. :(

I'll keep looking at it. For now it I can't find a quick fix for this issue.

DavyLandman commented 2 years ago

As a workaround I now download the hcloud tool, and then run that manually. But yeah, it sucks. Has the API changed?

saitho commented 2 years ago

This one? https://github.com/hetznercloud/cli Looks good. It would be probably better to use official tools. Not sure what changed in GH actions yet. :/

DavyLandman commented 2 years ago

yup that one, but I much prefer a more native action approach that you've taken.

Now i have to parse shell output to the IP out of it for example. looking at the source code, they did seem to have switched to hcapi2? so in their tool they also switched to a new API?