Skip to content

Prebuilds marking as failed but seem to have succeeded #7819

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

Closed
Tracked by #7812
CarterQC opened this issue Jan 25, 2022 · 3 comments
Closed
Tracked by #7812

Prebuilds marking as failed but seem to have succeeded #7819

CarterQC opened this issue Jan 25, 2022 · 3 comments
Labels
team: webapp Issue belongs to the WebApp team type: bug Something isn't working

Comments

@CarterQC
Copy link

Bug description

I have a repo that runs webpack as it's last step in a prebuild. Every step succeeds, and the logs show exit at the end and a successful prebuild message, but the prebuild is marked as a failure in the dashboard.

Example log:

gitpod /workspace/myapp $ {
> asdf install && mix local.rebar --force && mix local.hex --force
> 
> } && {
> gp await-port 5432 && sleep 5 && psql --command "CREATE USER dbuser WITH SUPERUSER PASSWORD '1234';" > /dev/null 2>&1 && mix deps.get && mix ecto.setup && MIX_ENV=test mix compile && cd assets && npm install && node node_modules/webpack/bin/webpack.js --mode=development
> 
> }; exit
elixir 1.11.4-otp-23 is already installed
==> Checking whether specified erlang release exists...
==> Downloading 23.3.4.7 to /home/gitpod/.asdf/downloads/erlang/23.3.4.7/OTP-23.3.4.7.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 62.0M  100 62.0M    0     0   107M      0 --:--:-- --:--:-- --:--:--  107M
==> Copying release into place

nodejs 14.17.6 is already installed
* creating /home/gitpod/.asdf/installs/elixir/1.11.4-otp-23/.mix/rebar
* creating /home/gitpod/.asdf/installs/elixir/1.11.4-otp-23/.mix/rebar3
* creating /home/gitpod/.asdf/installs/elixir/1.11.4-otp-23/.mix/archives/hex-1.0.1
Awaiting port 5432... ok
exit

🤙 This task ran as a workspace prebuild
🎉 Well done on saving 7 minutes

Steps to reproduce

  • Have a repo that runs node node_modules/webpack/bin/webpack.js --mode=development as the last step in init.
  • I have incremental prebuilds turned on too.
  • It seems like it might be waiting for some kind of signal from the webpack command that it's finished?
  • It does seem that if I add another step after, like echo "Init complete!", then it marks it as prebuilding successfully.

Workspace affected

No, it was all for this project

Expected behavior

I would expect it to show a successful prebuild.

Example repository

I'm sorry, I can't give an example as it's a private work repository, but here are the .gitpod.yml steps:

- name: phoenix
    before: >
      asdf install &&
      mix local.rebar --force &&
      mix local.hex --force
    init: >
      gp await-port 5432 &&
      sleep 5 &&
      psql --command "CREATE USER dbuser WITH SUPERUSER PASSWORD '1234';" > /dev/null 2>&1 &&
      mix deps.get &&
      mix ecto.setup &&
      MIX_ENV=test mix compile &&
      cd assets &&
      npm install &&
      node node_modules/webpack/bin/webpack.js --mode=development
    command: >
      gp await-port 5432 &&
      cd $GITPOD_REPO_ROOT &&
      iex -S mix phx.server

Anything else?

Not sure if this is an incremental prebuild issue.

@CarterQC
Copy link
Author

Linking to #7812 as recommended by Pauline

@jldec jldec added the team: webapp Issue belongs to the WebApp team label Jan 25, 2022
@jldec jldec moved this to Scheduled in 🍎 WebApp Team Jan 31, 2022
@geropl geropl added team: IDE type: bug Something isn't working team: webapp Issue belongs to the WebApp team and removed team: webapp Issue belongs to the WebApp team team: IDE labels Mar 1, 2022
@geropl
Copy link
Member

geropl commented Mar 1, 2022

@CarterQC Just found your issue. It looks like your last command node node_modules/webpack/bin/webpack.js --mode=development returns with an exit code other than 0 (cmp. code). This leads to the "failed" state. (that we report prebuild timings - and not mention the returnc code of your task - is bad UX here)

If you append another command - depending on how you do that - the end result might be return code 0, effectively fixing the preuilds.

Could this explain your issue? Could you try to print the return code webpack returns?

@geropl
Copy link
Member

geropl commented Apr 5, 2022

Closing this because likely a configuration error (cmp. comment above).

@geropl geropl closed this as completed Apr 5, 2022
Repository owner moved this from Scheduled to Done in 🍎 WebApp Team Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: webapp Issue belongs to the WebApp team type: bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants