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

apt-get update / install without -y causes setup hang #742

Closed
uuf6429 opened this issue Jun 4, 2023 · 6 comments
Closed

apt-get update / install without -y causes setup hang #742

uuf6429 opened this issue Jun 4, 2023 · 6 comments

Comments

@uuf6429
Copy link

uuf6429 commented Jun 4, 2023

https://github.com/shivammathur/php-ubuntu/blob/d752c0e323638e3fa5ae13654ab4935d7432657d/scripts/install.sh#L31

I'm trying to run shivammathur/setup-php@v2 through act, however it hangs up indefinitely.

So I connected a term session to the container, checked where it is stuck and manually checked through the running scripts:

root        19     0  0 19:15 pts/1    00:00:00 node /var/run/act/actions/shivammathur-setup-php@v2/dist/index.js
root        35    19  0 19:15 pts/1    00:00:00  \_ /usr/bin/bash /run/act/actions/shivammathur-setup-php@v2/src/scripts/run.sh
root        49    35  0 19:15 pts/1    00:00:00      \_ bash /tmp/install.sh 7.4 release
root       117    49  0 19:15 pts/1    00:00:00          \_ sudo apt --fix-broken install
root       118   117  0 19:15 pts/2    00:00:00              \_ sudo apt --fix-broken install
root       119   118  0 19:15 pts/2    00:00:00                  \_ apt --fix-broken install

Running the command manually (after manually deleting the apt lock), it asks me for confirmation; which I suppose is the root cause of the hang.

After some detective work, it seems that the code of install.sh is coming from this repository (I'm guessing is the script I linked at the top).

Wouldn't the following fix the problem?

    sudo apt --fix-broken install -y || (sudo apt-get update -y && sudo apt --fix-broken install -y)
@shivammathur
Copy link
Owner

@uuf6429
What is the command you are using to run act.

@uuf6429
Copy link
Author

uuf6429 commented Jun 5, 2023

Just "act", and selecting the "medium" image, since it actually has node 16.

@shivammathur
Copy link
Owner

Please try with images we maintain for setup-php.
https://github.com/shivammathur/setup-php#local-testing-setup

@uuf6429
Copy link
Author

uuf6429 commented Jun 5, 2023

Thanks that seems to work well!

@uuf6429 uuf6429 closed this as completed Jun 5, 2023
@uuf6429
Copy link
Author

uuf6429 commented Jun 5, 2023

@shivammathur actually, I still have one final problem - apparently that image does not contain docker itself, so I cannot start further services. Any suggestions?

(also, couldn't it make sense to just fix the original problem with php-ubuntu?)

PS: I've also updated the main description to be clearrr..

@uuf6429 uuf6429 reopened this Jun 5, 2023
@uuf6429 uuf6429 changed the title apt-get update / install with -y causes setup hang apt-get update / install without -y causes setup hang Jun 5, 2023
@shivammathur
Copy link
Owner

shivammathur commented Jun 5, 2023

I added the -y option in shivammathur/php-ubuntu@33b904a as it is harmless, but scripts in this repo are only meant to run on GitHub hosted runners which do not need this.

I will add a check in setup-php to make sure this repo is not used when it is run using act in the next release of the action.

Also, I have added docker to the shivammathur/node images, so please use those for running act.

@shivammathur shivammathur transferred this issue from shivammathur/php-ubuntu Jun 12, 2023
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

2 participants