projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 654 forks source link

Linux: Kudu Git deployment output is not in order #2699

Closed blueelvis closed 4 months ago

blueelvis commented 6 years ago

Repro steps.

  1. I have some commands in the deployment script.
  2. I push the changes to Azure Web App for Container using Kudu & Git.
  3. The output is not in order.

Project structures.

Drupal project

Debug your Azure website remotely.

https://pranav-linux-drupal.azurewebsites.net

Mention any other details that might be useful.

At the end of the Deployment script, I have piece of code like this -

###Check out Drush Configurations
cd /home/site ;
echo "$DEPLOYMENT_TARGET" ;
ls -la ;
echo "Finished Successfully!!!"
wget -O drush.phar -q https://github.com/drush-ops/drush/releases/download/8.1.16/drush.phar ;
echo "Making Drush.phar executable"
chmod +x drush.phar ;
echo "Getting Drush Status" ;

drush.phar --version ;
drush.phar --root="$DEPLOYMENT_TARGET" status -v;
drush.phar --root="$DEPLOYMENT_TARGET" updatedb --entity-updates -v -y;
#/home/site/drush.phar status -v ;
#/home/site/drush.phar site-install --no-interaction --yes -v;
#drush.phar qd --root=/home/site/wwwroot -y -v  ;
echo "Installed Drupal"
echo "Finished Successfully!!!"

Output which I got -

remote: ~/site/wwwroot ~/site/repository
remote: ~/site/repository
remote: /home/site/wwwroot
remote: total 5
remote: drwxrwxrwx 2 nobody nogroup    0 Feb 13 20:58 .
remote: drwxrwxrwx 2 nobody nogroup    0 Feb 13 19:38 ..
remote: drwxrwxrwx 2 nobody nogroup    0 Feb 13 20:24 config
remote: drwxrwxrwx 2 nobody nogroup    0 Feb 13 21:38 deployments
remote: drwxrwxrwx 2 nobody nogroup    0 Dec 30 16:40 diagnostics
remote: -rwxrwxrwx 1 nobody nogroup   10 Feb 13 21:37 ipaddr_0
remote: drwxrwxrwx 2 nobody nogroup    0 Feb 13 20:24 locks
remote: -rwxrwxrwx 1 nobody nogroup 3386 Feb  9 20:40 packages.json
remote: drwxrwxrwx 2 nobody nogroup    0 Feb 13 21:38 repository
remote: drwxrwxrwx 2 nobody nogroup    0 Feb 13 21:28 wwwroot
remote: Finished Successfully!!!
remote: Making Drush.phar executable
remote: Getting Drush Status
remote:  Drush Version   :  8.1.16
remote:
remote: Loading outputformat engine.                                            [notice]
remote:  PHP configuration      :  /etc/php/7.0/cli/php.ini
remote: Command dispatch complete                                               [notice]
remote:  PHP OS                 :  Linux
remote:  Drush script           :  /home/site/drush.phar
remote:  Drush version          :  8.1.16
remote:  Drush temp directory   :  /tmp
remote:  Drush configuration    :
remote:  Drush alias files      :
remote:
remote: Command updatedb needs a higher bootstrap level to run - you will        [error]
remote: Installed Drupal
remote: need to invoke drush from a more functional Drupal environment to run
remote: Finished Successfully!!!
remote: this command.
remote: The drush command 'updatedb' could not be executed.                      [error]
remote: Running post deployment command(s)...
remote: Deployment successful.
remote: App container will begin restart within 10 seconds.
To https://pranav-linux-drupal.scm.azurewebsites.net:443/pranav-linux-drupal.git
   b806545..27be5b0  master -> master
updating local tracking ref 'refs/remotes/azure/master'

As you can see, the "Installed Drupal" message should come after errors thrown by updatedb are outputted completely. Same goes for the last echo "Finished Successfully!!!" statement as well. Any idea what might be happening?

Thanks! -Pranav

nmajor commented 6 years ago

I'm having the same issue. Its trying to run the start script the deployment script. It sort of looks like the deployment script starts, then it tries to run the start script (Which doesnt exists because the deployment script builds the start script), then it finishes the deployment script.

Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 462 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id 'f544e669cb'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: Handling node.js deployment.
remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
remote: Start script "./build/index.js" from package.json is not found.
remote: Missing server.js/app.js files, web.config is not generated
remote: Looking for app.js/server.js under site root.
remote: The package.json file does not specify node.js engine version constraints.
remote: The node.js application will run with the default node.js version 6.9.1.
remote: Selected npm version 3.10.8
remote: Running "D:\Program Files (x86)\nodejs\6.9.1\node.exe" "D:\Program Files (x86)\npm\3.10.8\node_modules\npm\bin\npm-cli.js" install --production
remote: ...............................
remote: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\react-scripts\node_modules\fsevents):
remote: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
remote: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
remote: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
remote: npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none was installed.
remote: npm WARN bootstrap@4.0.0 requires a peer of jquery@1.9.1 - 3 but none was installed.
remote: Building...
remote: File D:\home\site\wwwroot/build/index.js exists
remote: Finished successfully.
remote: Running post deployment command(s)...
remote: Deployment successful.
blueelvis commented 6 years ago

@nmajor - I think just the output is messed up. The commands in fact are executed in the same order in which they are written... But, I could be wrong as well...

nmajor commented 6 years ago

I don't think its the display order, but it might be a bigger issue than just running things in the wrong order. I can only get the app working when I build on my local machine and commit the built files, which obviously isn't ideal.

remote: File D:\home\site\wwwroot/build/index.js exists

This line ^^ is output I have in the build script to show me if the build was successful or not. So it looks like the build works but it tries to run the package.json start script before the build finishes.

blueelvis commented 6 years ago

@davidebbo - There are quite some issues opened for the Web App for Containers but no one is responding. Is Nick the only guy who looks into these?

davidebbo commented 6 years ago

@LukaszStem and @rramachand21 are also in the Linux team and should be able to help out with some of those.

nmajor commented 6 years ago

Any update on this issue?

rramachand21-zz commented 6 years ago

@nmajor, if you have alwaysOn enabled on your site - the alwaysOn pinger will ping your site frequently to make sure its up. During the deployment, if the alwaysON request was sent to your main site, it will try to start your site..

rramachand21-zz commented 6 years ago

@blueelvis, we will look into this. thanks for the repro steps.

blueelvis commented 6 years ago

@rramachand21 - Talking about AlwaysOn requests, isn't that supposed not to do this? Did that cause such output?

blueelvis commented 6 years ago

@rramachand21 - Any update on this?

jvano commented 4 months ago

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano Azure App Service