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

Deploy failing #56

Open
gbuckingham89 opened this issue Jan 10, 2023 · 18 comments
Open

Deploy failing #56

gbuckingham89 opened this issue Jan 10, 2023 · 18 comments
Labels

Comments

@gbuckingham89
Copy link

gbuckingham89 commented Jan 10, 2023

We're suddenly seeing an error when deploying - here's the output from GHA:

(node:1943) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/home/runner/work/_actions/deployphp/action/v1/index.js:1
import core from '@actions/core'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

I guess it was caused by this commit: ba36add

I can supply more our workflow / deployment script if needed.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@antonmedv
Copy link
Member

Should be fixed.

@bes-internal
Copy link

bes-internal commented Jan 10, 2023

hotfix
 - name: Deploy
   uses: deployphp/[email protected]

@antonmedv latest release pointing to a non-working version 1.0.18 (as 1.0.12)

@gbuckingham89
Copy link
Author

Should be fixed.

Now getting another error;

Run deployphp/action@v1
node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'zx' imported from /home/runner/work/_actions/deployphp/action/v1/index.js
    at new NodeError (node:internal/errors:371:5)
    at packageResolve (node:internal/modules/esm/resolve:884:9)
    at moduleResolve (node:internal/modules/esm/resolve:929:18)
    at defaultResolve (node:internal/modules/esm/resolve:1044:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Will try @bes-internal's suggestion of locking to an earlier specific version for now.

@antonmedv antonmedv changed the title Deploy failing (ES module import error) Deploy failing Jan 10, 2023
@antonmedv
Copy link
Member

Should be fixed now.

@antonmedv
Copy link
Member

We need some tests)

@AKurka
Copy link

AKurka commented Jan 10, 2023

$ sudo chmod +x deployer.phar
Invalid JSON in options
$ php deployer.phar --no-interaction --ansi -v $'deploy prod' 

In Application.php line 709:

  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "deploy prod" is not defined.                           


Exception trace:
  at phar:///home/runner/work/Project/Project/deployer.phar/vendor/symfony/console/Application.php:709
 Symfony\Component\Console\Application->find() at phar:///home/runner/work/Project/Project/deployer.phar/vendor/symfony/console/Application.php:259
 Symfony\Component\Console\Application->doRun() at phar:///home/runner/work/Project/Project/deployer.phar/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///home/runner/work/Project/Project/deployer.phar/src/Deployer.php:317
 Deployer\Deployer::run() at phar:///home/runner/work/Project/Project/deployer.phar/bin/dep:96
 require() at /home/runner/work/Project/Project/deployer.phar:4

Error: Failed: dep deploy prod

Getting a new error there

And my host exists in my deploy.php

@malteschlueter
Copy link

Same for me. Exisiting deployment isn't running anymore. Seems like the $'deploy prod' isn't processed (correct)

@malteschlueter
Copy link

malteschlueter commented Jan 10, 2023

Is it possible that you set https://github.com/deployphp/action/releases/tag/v1.0.17 as the latest release again instead 1.0.12?

If I set the version in the GitHub action to uses: deployphp/[email protected] it works

grafik

@pawelgalerczykcat
Copy link

Same here :(

@antonmedv
Copy link
Member

Same here :(

Can't tell from this error message what is the problem.

@pawelgalerczykcat
Copy link

@antonmedv

$ sudo chmod +x deployer.phar
Invalid JSON in options
$ php deployer.phar --no-interaction --ansi -v $'deploy prod' 

In Application.php line 709:

  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "deploy prod" is not defined.                           


Exception trace:
  at phar:///home/runner/work/Project/Project/deployer.phar/vendor/symfony/console/Application.php:709
 Symfony\Component\Console\Application->find() at phar:///home/runner/work/Project/Project/deployer.phar/vendor/symfony/console/Application.php:259
 Symfony\Component\Console\Application->doRun() at phar:///home/runner/work/Project/Project/deployer.phar/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///home/runner/work/Project/Project/deployer.phar/src/Deployer.php:317
 Deployer\Deployer::run() at phar:///home/runner/work/Project/Project/deployer.phar/bin/dep:96
 require() at /home/runner/work/Project/Project/deployer.phar:4

Error: Failed: dep deploy prod

I suggest @malteschlueter I change version to 1.0.17 and it's working as previously

@ashwin-nath-m
Copy link

Hello, had to revert to 1.0.17
This was the error

Run deployphp/action@v1
with:
private-key: ***
dep: deploy dev
skip-ssh-setup: false
ansi: true
verbosity: -v
$ ssh-agent -a /tmp/ssh-auth.sock
SSH_AUTH_SOCK=/tmp/ssh-auth.sock; export SSH_AUTH_SOCK;
SSH_AGENT_PID=1729; export SSH_AGENT_PID;
echo Agent pid 1729;
$ ssh-add -
Identity added: (stdin) (admin)
Error: Cannot read properties of undefined (reading 'version')

@niekappartmedia
Copy link

@ashwin-nath-m I can confirm this same problem none of our actions are working anymore because of v1.0.12 being tagged as v1

@markovic-nikola
Copy link

Same as for @ashwin-nath-m happens to me:

$ ssh-agent -a /tmp/ssh-auth.sock
SSH_AUTH_SOCK=/tmp/ssh-auth.sock; export SSH_AUTH_SOCK;
SSH_AGENT_PID=1903; export SSH_AGENT_PID;
echo Agent pid 1903;
$ ssh-add -
Identity added: (stdin) (*******)
Error: Cannot read properties of undefined (reading 'version')

@subsan
Copy link

subsan commented Jan 18, 2023

I have the same problem as for @ashwin-nath-m
Error: Cannot read properties of undefined (reading 'version')
Revert to 1.0.17 help for me

@knewitzgui
Copy link

Any updates on this problem? im having the same issue

image

@cmorbitzer
Copy link

@knewitzgui I noticed that you are running deployphp/action@master. Do you still have this issue when running deployphp/action@v1? v1 is now pointing to a release that works for us.

@knewitzgui
Copy link

thanks for replying, yes, i tried with v1, master, v1.0.12, and others, nothing seems to work.

image

i will leave the config of the deploy so u can see what i am doing, and if u have any sugestions on how to solve this.

@polar-sh polar-sh bot added the Fund label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests