Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Grzegorz.Janoszka
Registered User
Posts: 13
Joined: Mon Jul 17, 2017 2:14 pm

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by Grzegorz.Janoszka »

I have downloaded the full package phpBB-3.2.1.tar.bz2 and unpacked it into a separate directory.
In my phpbb directory I moved vendor to vendor.old and moved here vendor directory from unpacked 3.2.1.
I have cleaned the whole cache directory with subdirectories.
The result is blank page and:

PHP message: PHP Catchable fatal error: Object of class Twig_Source could not be converted to string in /var/www/forum/phpbb/template/twig/lexer.php on line 147

So the next thing I did was to unpack the whole source of 3.2.1, keeping my styles, extensions and config.
The result:

PHP message: PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\OutOfBoundsException: The index "7" is not in the range [0, 6]. in /var/www/forum/vendor/symfony/dependency-injection/Definition.php:348
Stack trace:
#0 /var/www/forum/phpbb/di/extension/core.php(76): Symfony\Component\DependencyInjection\Definition->getArgument(7)
#1 /var/www/forum/vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php(59): phpbb\di\extension\core->load(Array, Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#2 /var/www/forum/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php(39): Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#3 /var/www/forum/vendor/symfony/dependency-injection/Compiler/Compiler.php(104): Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process(Object(Symfony\Component\Depend

The full upgrade method doesn't work either.
SunHunter
Registered User
Posts: 16
Joined: Mon Jul 17, 2017 7:37 pm

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by SunHunter »

I had the original Twig_Source error and no amount of deleting cache directories or deleting/re-uploading vendor folders seemed to help, so I did a full install of 3.2.1 retaining the 3.2.0 config.php, ext folder, files folder & the particular style (subfolder) that I'm using... the full install seemed to work in my case .
User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 5657
Joined: Tue Oct 30, 2007 10:57 pm
Location: Munich, Germany
Name: Marc
Contact:

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by Marc »

Based on the message it seems like the issue is not the vendor folder but not all files actually being updated.

Please state what exact update path you went when updating the files with the automatic update.
Re-uploading the vendor can't help when the lexer.php is outdated.
Grzegorz.Janoszka wrote: Tue Jul 18, 2017 7:45 am [...]
PHP message: PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\OutOfBoundsException: The index "7" is not in the range [0, 6]. in /var/www/forum/vendor/symfony/dependency-injection/Definition.php:348
Stack trace:
#0 /var/www/forum/phpbb/di/extension/core.php(76): Symfony\Component\DependencyInjection\Definition->getArgument(7)
#1 /var/www/forum/vendor/symfony/dependency-injection/Compiler/MergeExtensionConfigurationPass.php(59): phpbb\di\extension\core->load(Array, Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#2 /var/www/forum/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php(39): Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#3 /var/www/forum/vendor/symfony/dependency-injection/Compiler/Compiler.php(104): Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process(Object(Symfony\Component\Depend

The full upgrade method doesn't work either.
Please post the full stack trace.
Grzegorz.Janoszka
Registered User
Posts: 13
Joined: Mon Jul 17, 2017 2:14 pm

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by Grzegorz.Janoszka »

Marc wrote: Tue Jul 18, 2017 10:13 am Please state what exact update path you went when updating the files with the automatic update.
Re-uploading the vendor can't help when the lexer.php is outdated.
Well, the whole update package provides me three directories: docs, install and vendor. The procedure to upgrade phpBB is to replace the vendor directory with the new one and add the install directory.
The lexer.php is in phpbb directory and stays the same. Unfortunately it is used in the upgrade process and that's why it fails. The main page http://forum/install/ works, but any other tab fails.

If you think the above procedure is wrong, then please rewrite the phpBB documentation of upgrading one install to another as it clearly states you have to replace vendor and copy install.

Regarding the whole stack - this is what I had in logs. Not sure if I can make the logs provide more data.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by Mick »

I think FTP clients and server set up has something to do with it. I personally have NEVER had an issue with vendor folders or things not getting overwritten when they should. I use a quality host, a quality FTP client and always do a file replacement. That way I have plenty of time to relax and drink beer.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
Grzegorz.Janoszka
Registered User
Posts: 13
Joined: Mon Jul 17, 2017 2:14 pm

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by Grzegorz.Janoszka »

Mick wrote: Tue Jul 18, 2017 10:42 am I think FTP clients and server set up has something to do with it. I personally have NEVER had an issue with vendor folders or things not getting overwritten when they should. I use a quality host, a quality FTP client and always do a file replacement. That way I have plenty of time to relax and drink beer.
It is my server and I have full shell access to that. I never use FTP, just normal Linux commands (cp, mv...).
I have used phpBB for more than a year and I have done several upgrades with no major issues. This is the first time it really fails hard (PHP error).
maxwellqc13
Registered User
Posts: 145
Joined: Fri Mar 10, 2017 9:51 pm
Location: Iowa
Name: Max

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by maxwellqc13 »

I want to give up on this install. Tried every outlined step in this thread for the upgrade and always get the same error as OP. Tried the full install uploaded everything except Ext, Fies, Images, Store and Config.

Did install and received this error "The file differ failed to open Array."
[phpBB Debug] "file_get_contents(../install/update/new/adm/style/acp_ext_details.html): failed to open stream: No such file or directory" in file /home/grain/domains/mysite.com/public_html/GBN31_test/phpbb/install/module/update_filesystem/task/diff_files.php on line 175
User avatar
janus_zonstraal
Registered User
Posts: 6418
Joined: Sat Aug 30, 2014 1:30 pm

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by janus_zonstraal »

Mick wrote: Tue Jul 18, 2017 10:42 am I think FTP clients and server set up has something to do with it. I personally have NEVER had an issue with vendor folders or things not getting overwritten when they should. I use a quality host, a quality FTP client and always do a file replacement. That way I have plenty of time to relax and drink beer.
2 boards on the same server updated with no problems, number tree same error as TS?
Sorry! My English is bat ;) !!!
User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 5657
Joined: Tue Oct 30, 2007 10:57 pm
Location: Munich, Germany
Name: Marc
Contact:

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by Marc »

maxwellqc13 wrote: Tue Jul 18, 2017 6:19 pm I want to give up on this install. Tried every outlined step in this thread for the upgrade and always get the same error as OP. Tried the full install uploaded everything except Ext, Fies, Images, Store and Config.

Did install and received this error "The file differ failed to open Array."
[phpBB Debug] "file_get_contents(../install/update/new/adm/style/acp_ext_details.html): failed to open stream: No such file or directory" in file /home/grain/domains/mysite.com/public_html/GBN31_test/phpbb/install/module/update_filesystem/task/diff_files.php on line 175
You're pretty close already but seem to be using the files from the automatic update package as well. Remove the complete install folder and upload the one from the full package. Afterwards, make sure to delete the file store/install_config.php. Once you start the update via the installer, you should only be able to do a database update. Run that and the update should work fine.
It seems like right now you're still mixing a file update (which you already did according to your post) with the update using the full package.
maxwellqc13
Registered User
Posts: 145
Joined: Fri Mar 10, 2017 9:51 pm
Location: Iowa
Name: Max

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by maxwellqc13 »

Marc wrote: Tue Jul 18, 2017 9:16 pm You're pretty close already but seem to be using the files from the automatic update package as well. Remove the complete install folder and upload the one from the full package. Afterwards, make sure to delete the file store/install_config.php. Once you start the update via the installer, you should only be able to do a database update. Run that and the update should work fine.
It seems like right now you're still mixing a file update (which you already did according to your post) with the update using the full package.
I already had uploaded the install folder from the full package but did not delete the config. I did this and it and updated the DB successfully but then when I go to the site I get this
Catchable fatal error: Argument 7 passed to phpbb\template\twig\environment::__construct() must implement interface phpbb\event\dispatcher_interface, array given, called in /home/grain/domains/mysite.com/public_html/GBN31_test/cache/production/container_4335734bbdd20f586549a504dff5f80c.php on line 1413 and defined in /home/grain/domains/mysite.com/public_html/GBN31_test/phpbb/template/twig/environment.php on line 62
I tried to delete the cache/production folder but received the message
Unable to delete directory /domains/mysite.com/public_html/GBN31_test/cache/production: cannot unlinkat /domains/mysite.com/public_html/GBN31_test/cache/production/twig/a7/a7c65c041de68221bfbbe6c4ad9cfd241f0b49a0279c3f6c1919635f572eddc9.php: Permission denied
cannot unlinkat directory /domains/mysite.com/public_html/GBN31_test/cache/production/twig/a7: Directory not empty
cannot unlinkat directory /domains/mysite.com/public_html/GBN31_test/cache/production/twig: Director
maxwellqc13
Registered User
Posts: 145
Joined: Fri Mar 10, 2017 9:51 pm
Location: Iowa
Name: Max

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by maxwellqc13 »

With some work I was able to delete the cache files. Did install again said successful then this message again
Catchable fatal error: Argument 7 passed to phpbb\template\twig\environment::__construct() must implement interface phpbb\event\dispatcher_interface, array given in /home/grain/domains/mysite.com/public_html/GBN31_test/phpbb/template/twig/environment.php on line 62
RadioBoard
Registered User
Posts: 64
Joined: Sat Jun 27, 2015 5:06 pm

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by RadioBoard »

Grzegorz.Janoszka wrote: Tue Jul 18, 2017 7:13 am Well, a pity nobody really tested the upgrade procedure 3.2.0 --> 3.2.1 with PHP 7.x :(
FWIW, my forum is on a PHP 5.4.45 server and I had the same problem. The installer said it had completed successfully but the Twig error persisted. In my case, I think using Update via FTP (Manual) instead of (Automatic), which had worked in the past, fixed the problem. A bunch of files were then uploaded to the site. Elsewhere in this forum I've listed two of those many files, that were missing until I used the (Manual) method. But this doesn't work for everyone. Doing a full install should place all needed files in place and fix the problem, though it's tedious. Had I not already done the update, I'd be waiting for 3.2.2, as the Twig issue seems prolific.

Jim
JustChise
Registered User
Posts: 95
Joined: Thu Oct 30, 2014 4:56 am

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by JustChise »

Just wanted to follow up on this as I ran into the same issue with the twig/lexer.php error that was referenced by the OP and others. The only difference was it wasn't until I was about 35% of the way through the automated update. I tried deleting the cache and vendor folders and then re-uploading the vendor folders but nothing seemed to work. Then I noticed that not only was that error being thrown on the lexer.php file in the new/old install directory, it was also being thrown on the the lexer.php in the \phpbb\template\twig\ directory. So what I did was I took the new lexer.php from the install\update\new\phpbb\template\twig and moved it to the \phpbb\template\twig\ directory. This got rid of the error and the update was able to complete seamlessly.

Having said that, there's one thing I want to point out: originally I used the 'update via FTP' option where you enter your FTP info and it connects and updates. That didn't work; that's where I got the error. When I decided to move the lexer.php file, I accicentally clicked the 'update via direct access' option. So I cannot say for certain it was because I moved the lexer.php file to the \phpbb\template\twig\ directory or if it was because I used the direct access vs FTP update method. Either way, I don't feel like going back and proving whether it was the act of moving the lexer.php file or the direct access method. Just felt I should point that out.
Grzegorz.Janoszka
Registered User
Posts: 13
Joined: Mon Jul 17, 2017 2:14 pm

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by Grzegorz.Janoszka »

I see automated updates are gone from the download page. Anyway after several tries the fresh install worked.
User avatar
rht
Registered User
Posts: 2
Joined: Thu Sep 28, 2017 4:20 pm
Location: UK

Re: Error upgrading 3.2.0 to 3.2.1 (Twig_Source)

Post by rht »

Have just started the process of upgrading my forum to 3.2.1 and encountered exactly this problem. After a bit of head scratching, I got my local copy working, so I wanted to post my successful fix to this.

"phpBB-3.2.0_to_3.2.1.zip" from the changed files archive appears to be missing the "vendor" folder. Looking through the changes, the version of "twig" has changed, which would explain the error. So, you definitely do need to update the vendor folder. I did this by renaming the old one and copying in the one from the complete 3.2.1 download.

The rest of the files I simply copied over the top from the changed files archive. I ran the database update from the command line, cleared the cache and everything is working once more. :D

Cheers R.
CentOS 7.2 / PHP 5.4 / MariaDB 5.5
Post Reply

Return to “[3.2.x] Support Forum”