In testing the farmOS Docker branch (https://github.com/farmOS/farmOS/issues/15), I'm finding that farmOS cannot be installed on an SQLite database. It works fine on a MySQL database, though. PostgreSQL has yet to be tested.
The following error always occurs during installation on SQLite:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://172.17.0.2/install.php?profile=farm&locale=en&id=1&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[HY000]: General error: 1 no such table: farm_asset_type: SELECT base.id AS id, base.type AS type, base.label AS label, base.status AS status, base.module AS module FROM {farm_asset_type} base; Array ( ) in EntityAPIController->query() (line 187 of /var/www/html/profiles/farm/modules/contrib/entity/includes/entity.controller.inc).
The fact that it says "General error: 1 no such table: farm_asset_type" suggests that maybe the farm_asset module's database tables are not compatible with SQLite. That would be a good place to start.
Comments
Comment #2
m.stentaUpdate: I'm honing in on this a little more.
I confirmed that it is definitely the farm_asset module causing this issue.
I commented out all the contrib and farm dependencies in the farmOS installation profile's farm.info file:
I also had to remove all the code from farm.install - because that depended on some of the contrib stuff.
This allowed me to complete install.php without the error. Then I went to /admin/modules and enabled JUST the farm_asset module (along with it's dependencies automatically).
That gave me the following error:
Comment #3
m.stentaAh ha! I think I understand now...
SQLite handles database indexes differently, so there appears to be a conflict with the "type" index created for the {farm_asset} table, and the "type" index created for the "farm_asset_type" table.
A little searching found these similar issues in other Drupal modules:
#1876872: SQLite error: "there is already an index named entityform_type"
#1941448: Message module fails to install with SQLite (TABLE and INDEX both named "message_type")
It looks like this will be easy to solve simply by renaming one of the database indexes.
Comment #4
m.stentaI pushed commits to both farm_asset and log to fix the same issue in both modules.
After that, I discovered there is an outstanding issue with the Pathauto module that causes a PHP maximum execution time error: #2582655: Pathauto 7.x-1.3 causes timeouts with SQLite
So I included that patch in the farmOS makefile, while we wait for the new version of Pathauto to be released.
Comment #5
m.stentaCommits for reference:
http://cgit.drupalcode.org/farm_asset/commit/?id=c78c18e
http://cgit.drupalcode.org/log/commit/?id=57d125c
http://cgit.drupalcode.org/farm/commit/?id=a82955d