XF 2.0 File Permissions (chmod)

Fred.

Well-known member
Can someone tell me what the correct File Permissions are for XF2? Especially for the src folder and files in it.
XF 1.x always gave a warning to change the permission, XF2 doesn't seems to do that anymore. It just throws an error.
I'm running into a error if I try to upgrade XFMG

Code:
ErrorException: file_put_contents(/home/admin/domains/example.com/subdomains/test/private_html/xf2/internal_data/code_cache/phrase_groups/l1/widget.php): failed to open stream: Permission denied in src/vendor/league/flysystem/src/Adapter/Local.php at line 196
XF::handlePhpError()
file_put_contents() in src/vendor/league/flysystem/src/Adapter/Local.php at line 196
League\Flysystem\Adapter\Local->update() in src/vendor/league/flysystem/src/Filesystem.php at line 98
League\Flysystem\Filesystem->put()
call_user_func_array() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 431
League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 395
League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 57
League\Flysystem\EventableFilesystem\EventableFilesystem->put()
call_user_func_array() in src/vendor/league/flysystem/src/MountManager.php at line 269
League\Flysystem\MountManager->invokePluginOnFilesystem() in src/vendor/league/flysystem/src/MountManager.php at line 179
League\Flysystem\MountManager->__call() in src/XF/Util/File.php at line 99
XF\Util\File::writeToAbstractedPath() in src/XF/Service/Phrase/Group.php at line 49
XF\Service\Phrase\Group->compilePhraseGroup() in src/XF/Entity/Phrase.php at line 180
XF\Entity\Phrase->XF\Entity\{closure}() in src/XF.php at line 236
XF::triggerRunOnce() in src/XF/Mvc/Dispatcher.php at line 128
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1771
XF\App->run() in src/XF.php at line 319
XF::runApp() in admin.php at line 13
 
That error is nothing to do with the src directory, which requires no special permissions.

It's basically the same as XF1. The data and internal_data directories (and contents) should be world writable (777).
 
That error is nothing to do with the src directory, which requires no special permissions.

It's basically the same as XF1. The data and internal_data directories (and contents) should be world writable (777).
I fixed that with chmod 777 on these directories. But there is more going on, It can't find the XFMG tables. I will start a new clean update. But that's for another day. :coffee: :sleep:
My DB is also 1/3 smaller then in XF 1.5. :eek:
Most of the xengallery tables seems to be missing, only 2 tables in the DB. :unsure:
 
Missing tables doesn’t sound correct.

Though if you have already completed the XFMG upgrade then those tables have been renamed (look for xf_mg_ prefixed tables) so I would actually be concerned if you have any tables left with a xengallery_ prefix.

What are they? And do you have xf_mg_ tables?
 
I tried to run the upgrade, then I ran into the error.
Aha, the missing tables have the xf_mg_ prefix

only these have not.
xengallery_content_tag
dot.gif
dot.gif

xengallery_content_tag_map

Also check this @Chris D same problem I guess.
https://xenforo.com/community/threads/error-on-upgrading-to-2-0.133579/
 
I tried to run the upgrade, then I ran into the error.
What was your error?

The issues are similar in that an error occurred on the first upgrade attempt, but that's it. The important thing is what caused the failed upgrade attempt in the first place.
 
This is the error
Code:
XF\Db\Exception: MySQL query error [1146]: Table 'test_xf2_rfnet.xengallery_album' doesn't exist in src/XF/Db/AbstractStatement.php at line 183
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 66
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 67
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 94
XF\Db\AbstractAdapter->fetchAllKeyed() in src/XF/Db/SchemaManager.php at line 92
XF\Db\SchemaManager->getTableColumnDefinitions() in src/XF/Db/Schema/Alter.php at line 30
XF\Db\Schema\Alter->__construct() in src/XF/Db/SchemaManager.php at line 211
XF\Db\SchemaManager->newAlter() in src/XF/Db/SchemaManager.php at line 145
XF\Db\SchemaManager->renameTable() in src/addons/XFMG/Setup.php at line 632
XFMG\Setup->upgrade902000010Step1() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 143
XFMG\Setup->upgradeStepRunner() in src/XF/AddOn/StepRunnerUpgradeTrait.php at line 79
XFMG\Setup->upgrade() in src/XF/Admin/Controller/AddOn.php at line 424
XF\Admin\Controller\AddOn->actionUpgrade() in src/XF/Mvc/Dispatcher.php at line 232
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 85
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1771
XF\App->run() in src/XF.php at line 319
XF::runApp() in admin.php at line 13
 
Was that definitely the first error you hit, or did something else go wrong first then attempting to retry the upgrade caused that error?
 
Was that definitely the first error you hit, or did something else go wrong first then attempting to retry the upgrade caused that error?
Before I had the error in the first post.

But maybe this happened because I had a few problems with the CLI update.

The first one was
Code:
Running upgrade to 2.0.0 Alpha, step 1... done.
Running upgrade to 2.0.0 Alpha, step 2... done.
Running upgrade to 2.0.0 Alpha, step 3...
                                                             
  [LogicException]                                            
  xf_widget already exists, but the structure does not match.
So i renamed the table

Then when I tried to run the update again I got.
Code:
[LogicException]                                              
  xf_upgrade_job already exists, but the structure does not match.
So I dropped that table and run the upgrade.

So maybe it happened because I dropped the table and ran it again?
I will do a new clean upgrade to see if it happens again, but not tomorrow because I probably don't have time tomorrow.
 
I finally finished the update with succes. I had to restart the whole process again about 5 times! :X3: :D :coffee::coffee::coffee:

There were 2 problems. The first one was the widget framework that was using a table that xf2 wanted to create.
Solved by removing widget framework.
The second problem is when I do something from CLI and it writes files to one of the data directories the files are not world writable.
So every time I have to do
Code:
chmod -R 777 data
chmod -R 777 internal_data
Because the files in internal_data/code_cache where not writable the XFMG upgrade failed. After I changed the permissions and ran the update again it failed because it renamed the tables before and couldn't find the tables if I tried to run the update again.
I made a 13 step plan (specific to my setup) so the final upgrade is going to go fast. :cool: I always do this with major updates. (y)
 
I finally finished the update with succes. I had to restart the whole process again about 5 times! :X3: :D :coffee::coffee::coffee:

There were 2 problems. The first one was the widget framework that was using a table that xf2 wanted to create.
Solved by removing widget framework.
The second problem is when I do something from CLI and it writes files to one of the data directories the files are not world writable.
So every time I have to do
Code:
chmod -R 777 data
chmod -R 777 internal_data
Because the files in internal_data/code_cache where not writable the XFMG upgrade failed. After I changed the permissions and ran the update again it failed because it renamed the tables before and couldn't find the tables if I tried to run the update again.
I made a 13 step plan (specific to my setup) so the final upgrade is going to go fast. :cool: I always do this with major updates. (y)
Thank you!
 
Top Bottom