I received the error when I try to run on the live site. ( I was able to upgrade to 2.2.9 for the test site, which was cloned from the live site).
after i did
composer require magento/product-community-edition 2.2.9 --no-update
for updating from magento 2.2.6. to 2.2.9 (which went fine), then ..
php bin/magento setup:upgrade
error message is .........
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/username/m2stagenew/generated/code/Magento/Framework/App/Config/Value/Interceptor.php on line ....
magento version is 2.2.7 - > 2.2.9
php -v ---> shown php version is 7.0.033
but in siteground cpanel, shown "PHP 7.1.30" is selected"
I have searched and found a few answers, but all applied to 2.3.x version, which required high php versions (7.1 or 7.2). so i also tried the following command
php72 bin/magento setup:upgrade
which came out with another error..