Pantheon Academy - Drupal Core Updates on Pantheon
Overview
NOTE: We try our best to merge Drupal updates as close to their release as possible. However, pushing updates on Pantheon requires some work on our side. Available updates will appear on your dashboard after review and testing by our team, usually within a week of release.
DO NOT UPDATE CORE THROUGH THE DRUPAL ADMIN OR DRUSH. YOU WILL OVERWRITE YOUR CORE.
YOU CANNOT UNPACK A TARBALL FROM DRUPAL.ORG: THIS WILL OVERWRITE THE PRESSFLOW CORE's AUTO-CONFIGURATION FEATURE AND YOUR SITE WILL LOSE ITS DATABASE CONNECTION.
ONLY USE THE ONE-CLICK UPDATES ON THE DASHBOARD TO UPDATE YOUR DRUPAL CORE.
If you have overwritten core, see this document to find out how to revert to the last stable commit.
Steps
Applying a core update
The good news is that the git merge from the Pantheon upstream can be applied with one click from the dashboard and these will appear directly in your code Workspace above your code log:
When you are ready to perform the merge you can start the process by clicking on the "Apply Updates" button in the message box above the code log. If you find that there are errors and would like to revert to the last stable commit, this can be done via git.
That's it! Your core is now up to date.
Also, from time to time we will include new features and bug fixes ahead of a Drupal Core release. Generally speaking, if there is an update available, you're best off merging it.
Debugging Failed Merges
If the automated Drupal core update doesn't appear to be working, it's possible there are conflicts with your codebase in the update. Usually these are easy to resolve. Here are debugging steps to find the conflicts and correct them.
Auto-resolve Conflicts
In the event that the update fails you may get an error similar to the one below because of a conflict in some files in core.
The next step is to perform the update using the "Auto-resolve" option available on the form that appears. We will try to automatically merge any changes with the most recent updates available in that release.
Note: It is important to note that this DOES NOT solve all problems that may arise but it should take care of most situations.
In the event the "Auto-resolve conflicts" option fails the next step will be to manually pull your changes in using git, resolve the conflicts that arise and then push the update up to your Pantheon site.
Drupal 7
From within an up to date git clone in your local environment:
git pull git://github.com/pantheon-systems/drops-7.git master # resolve conflicts here if needed... git push origin master
You can add the -Xtheirs flag if you just want to accept all our changes.
Drupal 6
From within an up to date git clone in your local environment:
git pull git://github.com/pantheon-systems/drops-6.git master # resolve other conflicts here if needed... git push origin master
For more information on resolving conflicts, please see the Git FAQ page.
Troubleshooting
Manually Resolving Conflicts
Conflicts can occur when the upstream you are trying to merge your code with has made alterations to files.
"When a merge isn’t resolved automatically, git leaves the index and the working tree in a special state that gives you all the information you need to help resolve the merge." - Git Manual
Delete Merge Conflicts
To manually delete merge conflicts from the terminal, use the following commands in sequence:
-
Start by identifying the file that is generating a delete error.
For example, the git log may contain an entry similar to the following:
CONFLICT (delete/modify): scripts/run-tests.sh deleted in HEAD and modified in 72faeeff1c9356221694d1351cdb2000ab3c5d1c. Version 72faeeff1c9356221694d1351cdb2000ab3c5d1c of scripts/run-tests.sh left in tree."
From your local repository, you can run the following git command, which will get you a copy of the file in conflict:
git checkout <commit ID> -- <file>
When looking for a commit ID, you can find the last instance where the missing file was in the repository.
-
Run git status and verify that their is a new file to add to the repository:
git status # On branch master # Changes to be committed: # (use "git reset HEAD
..." to unstage) # # new file: README.txt # -
Next, you will need to run:
git add .
-
After performing the add, commit the file with an accompanying commit message.
git commit -am "verifying missing README.txt"
You will receive confirmation from git that the file has been committed.
-
Lastly, you will need to run:
git push origin master
503s When Running Update.php & Installing Modules
There are multiple reasons that 503s might occur when updating:
-
PHP segfault: these are notoriously tricky to troubleshoot since very little debugging information is present, though Pantheon engineering is currently working on a fix. A temporary fix is available, contact Pantheon Support if you think you have been affected.
-
Timeouts would be another cause of 503s, though they are much less likely to occur if you are using the Pantheon domains. Still, if the operation takes more than sixty seconds, you might see a timeout occur.
Pantheon Helpdesk