pantheon-systems / terminus

The Pantheon CLI — a standalone utility for performing operations on the Pantheon Platform
https://pantheon.io
Other
316 stars 194 forks source link

`getCommits()` function error when running env:deploy #1806

Open tdmalone opened 6 years ago

tdmalone commented 6 years ago

Expected behavior

Expected the site to deploy from the dev to test environment.

Actual behavior

Receive the following error:

PHP Fatal error:  Uncaught Error: Call to a member function getCommits() on null in /root/terminus/vendor/pantheon-systems/terminus/src/Models/Environment.php:254

As requested, the verbose output (I've redacted anything which looked like it contained identifying information):

$ terminus env:deploy SITE_NAME.dev -vvv
 [debug] Plugin Autoload: %dir is a Terminus source file.
 [debug] #### REQUEST ####
Headers: {"Content-type":"application\/json","User-Agent":"Terminus\/1.6.1 (php_version=7.0.9&script=bin\\terminus)","Authorization":"**HIDDEN**"}
URI: https://terminus.pantheon.io:443/api/site-names/SITE_NAME
Method: GET
Body: null
 [debug] #### RESPONSE ####
Headers: {"Server":["nginx"],"Date":["Mon, 11 Dec 2017 06:26:07 GMT"],"Content-Type":["application\/json; charset=utf-8"],"Transfer-Encoding":["chunked"],"Connection":["keep-alive"],"X-Pantheon-Trace-Id":["**REDACTED**"],"X-Frame-Options":["deny"],"Access-Control-Allow-Methods":["GET"],"Access-Control-Allow-Headers":["Origin, Content-Type, Accept"],"Cache-Control":["private, max-age=0, no-cache, no-store"],"Pragma":["no-cache"],"Vary":["Accept-Encoding"],"Strict-Transport-Security":["max-age=31536000"]}
Data: {"id":"**REDACTED**","name":"SITE_NAME"}
Status Code: 200
 [debug] #### REQUEST ####
Headers: {"Content-type":"application\/json","User-Agent":"Terminus\/1.6.1 (php_version=7.0.9&script=bin\\terminus)","Authorization":"**HIDDEN**"}
URI: https://terminus.pantheon.io:443/api/sites/**REDACTED**?site_state=true
Method: GET
Body: null
 [debug] #### RESPONSE ####
Headers: {"Server":["nginx"],"Date":["Mon, 11 Dec 2017 06:26:08 GMT"],"Content-Type":["application\/json"],"Content-Length":["2881"],"Connection":["keep-alive"],"X-Pantheon-Trace-Id":["**REDACTED**"],"X-Frame-Options":["deny"],"Access-Control-Allow-Methods":["GET"],"Access-Control-Allow-Headers":["Origin, Content-Type, Accept"],"Cache-Control":["private, max-age=0, no-cache, no-store"],"Pragma":["no-cache"],"Vary":["Accept-Encoding"],"Strict-Transport-Security":["max-age=31536000"]}
Data: {"created":1512525540,"created_by_user_id":"**REDACTED**","framework":"wordpress","holder_id":"**REDACTED**","holder_type":"user","last_code_push":{"timestamp":"2017-12-11T06:24:46","user_uuid":"**REDACTED**"},"name":"SITE_NAME","owner":"**REDACTED**","php_version":"55","preferred_zone":"us-central1","service_level":"free","upstream":{"repository_branch":"master","machine_name":"wordpress","product_id":"**REDACTED**","url":"https:\/\/github.com\/pantheon-systems\/WordPress","label":"WordPress","organization_id":"","framework":"wordpress","branch":"master","repository_url":"https:\/\/github.com\/pantheon-systems\/WordPress","type":"core","id":"**REDACTED**"},"label":"SITE_NAME","id":"**REDACTED**","holder":{"profile":{"seens":{"global-cdn":true},"web_services_business":null,"full_name":"**REDACTED**","firstname":"**REDACTED**","lastname":"**REDACTED**","pda_campaign":null,"modified":1504470215,"verify":"**REDACTED**","experiments":{"welcome_video":"not_shown"},"initial_identity_name":null,"registration_context":null,"maxdevsites":2,"pullFromLive":true,"job_function":"","organization":"","guilty_of_abuse":null,"initial_identity_strategy":null},"id":"**REDACTED**","email":"**REDACTED**.**REDACTED**@SITE_NAME.com"},"settings":{"allow_domains":false,"max_num_cdes":10,"stunnel":false,"min_backups":0,"owner":"**REDACTED**","secure_runtime_access":false,"pingdom":0,"allow_indexserver":false,"created_by_user_id":"**REDACTED**","failover_appserver":0,"cacheserver":1,"support_plan":"regular_support","on_server_development":false,"drush_version":5,"label":"SITE_NAME","appserver":1,"allow_read_slaves":false,"indexserver":1,"php_version":"55","php_channel":"stable","allow_cacheserver":false,"ssl_enabled":null,"current_num_domains":0,"service_level":"free","dedicated_ip":null,"dbserver":1,"framework":"wordpress","max_total_domains":0,"upstream":{"url":"https:\/\/github.com\/pantheon-systems\/WordPress","product_id":"**REDACTED**","branch":"master"},"guilty_of_abuse":null,"preferred_zone":"us-central1","pingdom_chance":0,"holder_id":"**REDACTED**","name":"SITE_NAME","created":1512525540,"max_backups":0,"holder_type":"user","replica_verification_strategy":"pt-heartbeat","pingdom_manually_enabled":false,"last_code_push":{"timestamp":"2017-12-11T06:24:46","user_uuid":"**REDACTED**"}},"base_domain":null,"attributes":{"label":"SITE_NAME","m3_ui":true},"add_ons":[{"id":"NewRelic","label":"New Relic"}]} Status Code: 200
 [debug] #### REQUEST ####
Headers: {"Content-type":"application\/json","User-Agent":"Terminus\/1.6.1 (php_version=7.0.9&script=bin\\terminus)","Authorization":"**HIDDEN**"}
URI: https://terminus.pantheon.io:443/api/sites/**REDACTED**/environments
Method: GET
Body: null
 [debug] #### RESPONSE ####
Headers: {"Server":["nginx"],"Date":["Mon, 11 Dec 2017 06:26:09 GMT"],"Content-Type":["application\/json; charset=utf-8"],"Transfer-Encoding":["chunked"],"Connection":["keep-alive"],"X-Pantheon-Trace-Id":["**REDACTED**"],"X-Frame-Options":["deny"],"Access-Control-Allow-Methods":["GET"],"Access-Control-Allow-Headers":["Origin, Content-Type, Accept"],"Cache-Control":["private, max-age=0, no-cache, no-store"],"Pragma":["no-cache"],"Vary":["Accept-Encoding"],"Strict-Transport-Security":["max-age=31536000"]}
Data: {"live":{"is_initialized":true,"styx_clusters_for_cache_clear":["styx-03.pantheon.io","styx-1-gcp-fastly-stub.pantheon.io","edge.live.getpantheon.com","styx-fe1.pantheon.io","styx-02.pantheon.io","styx-fe2.pantheon.io","styx-yolo.pantheon.io","styx-fe4.pantheon.io","styx-fe3.pantheon.io","styx-01.pantheon.io"],"environment_created":1512525542,"dns_zone":"pantheonsite.io","randseed":"**REDACTED**","target_commit":"6c37519eb1ff479657b3fc7e7d2befd835172858","target_ref":"refs\/tags\/pantheon_live_2","php_version":"70","lock":{"username":null,"password":null,"locked":false},"environment_variables":{"php_version":7},"styx_cluster":"styx-fe1.pantheon.io"},"dev":{"quicksilver_configuration":{},"is_initialized":true,"watchers":1,"styx_clusters_for_cache_clear":["styx-03.pantheon.io","styx-1-gcp-fastly-stub.pantheon.io","edge.live.getpantheon.com","styx-fe1.pantheon.io","styx-02.pantheon.io","styx-fe2.pantheon.io","styx-yolo.pantheon.io","styx-fe4.pantheon.io","styx-fe3.pantheon.io","styx-01.pantheon.io"],"diffstat":{},"on_server_development":false,"environment_created":1512525540,"dns_zone":"pantheonsite.io","randseed":"**REDACTED**","target_commit":"fec32948ae9eb92018b0078ab9f0afcd758d74ff","target_ref":"refs\/heads\/master","php_version":"70","lock":{"username":null,"password":null,"locked":false},"environment_variables":{"php_version":7},"styx_cluster":"styx-fe2.pantheon.io"},"test":{"is_initialized":true,"styx_clusters_for_cache_clear":["styx-03.pantheon.io","styx-1-gcp-fastly-stub.pantheon.io","edge.live.getpantheon.com","styx-fe1.pantheon.io","styx-02.pantheon.io","styx-fe2.pantheon.io","styx-yolo.pantheon.io","styx-fe4.pantheon.io","styx-fe3.pantheon.io","styx-01.pantheon.io"],"environment_created":1512525541,"dns_zone":"pantheonsite.io","randseed":"**REDACTED**","target_commit":"6c37519eb1ff479657b3fc7e7d2befd835172858","target_ref":"refs\/tags\/pantheon_test_4","php_version":"70","lock":{"username":null,"password":null,"locked":false},"environment_variables":{"php_version":7},"styx_cluster":"styx-fe3.pantheon.io"}}
Status Code: 200
PHP Fatal error:  Uncaught Error: Call to a member function getCommits() on null in C:\Users\Tim\vendor\pantheon-systems\terminus\src\Models\Environment.php:254
Stack trace:
#0 C:\Users\Tim\vendor\pantheon-systems\terminus\src\Models\Environment.php(564): Pantheon\Terminus\Models\Environment->countDeployableCommits()
#1 C:\Users\Tim\vendor\pantheon-systems\terminus\src\Commands\Env\DeployCommand.php(51): Pantheon\Terminus\Models\Environment->hasDeployableCode()
#2 [internal function]: Pantheon\Terminus\Commands\Env\DeployCommand->deploy('SITE_NAME.dev', Array)
#3 C:\Users\Tim\vendor\consolidation\annotated-command\src\CommandProcessor.php(235): call_user_func_array(Array, Array)
#4 C:\Users\Tim\vendor\consolidation\annotated-command\src\CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 C:\Users\Tim\vendor\consolidation\annotated-command\src\CommandProcessor.php(147): Consolidation\AnnotatedCommand\CommandProcessor->validateRu in C:\Users\Tim\vendor\pantheon-systems\terminus\src\Models\Environment.php on line 254

Fatal error: Uncaught Error: Call to a member function getCommits() on null in C:\Users\Tim\vendor\pantheon-systems\terminus\src\Models\Environment.php:254
Stack trace:
#0 C:\Users\Tim\vendor\pantheon-systems\terminus\src\Models\Environment.php(564): Pantheon\Terminus\Models\Environment->countDeployableCommits()
#1 C:\Users\Tim\vendor\pantheon-systems\terminus\src\Commands\Env\DeployCommand.php(51): Pantheon\Terminus\Models\Environment->hasDeployableCode()
#2 [internal function]: Pantheon\Terminus\Commands\Env\DeployCommand->deploy('SITE_NAME.dev', Array)
#3 C:\Users\Tim\vendor\consolidation\annotated-command\src\CommandProcessor.php(235): call_user_func_array(Array, Array)
#4 C:\Users\Tim\vendor\consolidation\annotated-command\src\CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 C:\Users\Tim\vendor\consolidation\annotated-command\src\CommandProcessor.php(147): Consolidation\AnnotatedCommand\CommandProcessor->validateRu in C:\Users\Tim\vendor\pantheon-systems\terminus\src\Models\Environment.php on line 254

Steps to reproduce the behavior

  1. Run terminus env:deploy SITE_NAME.dev

As requested, output of terminus self:info:

$ terminus self:info
 ------------------------- -----------------------------------------------
  PHP binary                C:\xampp7\php\php.exe
  PHP version               7.0.9
  php.ini used              C:\xampp7\php\php.ini
  Terminus project config
  Terminus root dir         C:\Users\Tim\vendor\pantheon-systems\terminus
  Terminus version          1.6.1
  Operating system          build 15063 (Windows 10)
 ------------------------- -----------------------------------------------

The exact same error appears on my Linux box as well, so here's the output for that:

14:26:36-root~$ terminus self:info
 ------------------------- ------------------------------------------------- 
  PHP binary                /usr/bin/php                                     
  PHP version               7.0.22                                           
  php.ini used              /etc/php.ini                                     
  Terminus project config                                                    
  Terminus root dir         /root/terminus/vendor/pantheon-systems/terminus  
  Terminus version          1.6.1                                            
  Operating system          #1 SMP Tue Aug 22 18:51:35 UTC 2017              
 ------------------------- ------------------------------------------------- 
tdmalone commented 6 years ago

I've just realised I should have been running terminus env:deploy SITE_NAME.test, not .dev. D'oh!

Having said that, I'll leave this open in case you want to look at catching that error. A more friendly 'you cannot deploy to the dev environment' would probably be helpful ;)