marellocommerce / marello-application

Marello Application
Other
85 stars 35 forks source link

Upgrade from 2.1 to 2.2 fails #10

Open Vinai opened 5 years ago

Vinai commented 5 years ago

Steps to reproduce:

  1. Clean 2.1 install without any customizations
  2. git fetch && git checkout 2.2.0
  3. rm -r var/cache/* public/js/* public/css/*
  4. ./bin/console oro:platform:update --env=dev --force

Note: no consumers or cron jobs running.

Result:

Check system requirements
+---------+---------------------------------------------------------------------------------+
| Check   | Optional recommendations                                                        |
+---------+---------------------------------------------------------------------------------+
| WARNING | Disable Phar extension to reduce the risk of PHP unserialization vulnerability. |
| WARNING | Install and enable the IMAP extension.                                          |
+---------+---------------------------------------------------------------------------------+
The application meets all mandatory requirements
Process migrations...
  > Oro\Bundle\EntityExtendBundle\Migration\LoadEntityConfigStateMigration
  > Marello\Bundle\PaymentTermBundle\Migrations\Schema\MarelloPaymentTermBundleInstaller
  > Marello\Bundle\CustomerBundle\Migrations\Schema\MarelloCustomerBundleInstaller
  > Marello\Bundle\ProductBundle\Migrations\Schema\v1_7\UpdateAttachmentFieldConfigForProductImage
  > Marello\Bundle\OrderBundle\Migrations\Schema\v1_8_2\MarelloOrderBundle
  > Marello\Bundle\OrderBundle\Migrations\Schema\v1_9\MarelloOrderBundle
  > Marello\Bundle\RefundBundle\Migrations\Schema\v1_2\MarelloRefundBundle
  > Marello\Bundle\InventoryBundle\Migrations\Schema\v2_1_1\UpdateInventoryEntitiesConfig
  > Marello\Bundle\InventoryBundle\Migrations\Schema\v2_2\MarelloInventoryBundle
  > Marello\Bundle\InvoiceBundle\Migrations\Schema\v1_0_1\MarelloInvoiceBundle
  > Marello\Bundle\InvoiceBundle\Migrations\Schema\v1_1\MarelloInvoiceBundle
  > Marello\Bundle\ReturnBundle\Migrations\Schema\v1_3\MarelloReturnBundle
  > Marello\Bundle\PackingBundle\Migrations\Schema\v1_2\MarelloPackingBundle
  > Marello\Bundle\PurchaseOrderBundle\Migrations\Schema\v1_3_1\MarelloPurchaseOrderBundle
  > Oro\Bundle\MigrationBundle\Migration\UpdateBundleVersionMigration
  > Oro\Bundle\EntityExtendBundle\Migration\CleanupTrackingMigration
  > Oro\Bundle\EntityExtendBundle\Migration\CleanupMarketingListMigration
  > Oro\Bundle\EntityExtendBundle\Migration\CleanupCampaignMigration
  > Oro\Bundle\EntityExtendBundle\Migration\RefreshExtendCacheMigration
  > Oro\Bundle\EntityConfigBundle\Migration\UpdateEntityConfigMigration
  > Oro\Bundle\EntitySerializedFieldsBundle\Migration\SerializedDataMigration
  > Oro\Bundle\EntityExtendBundle\Migration\UpdateExtendConfigMigration
  > Oro\Bundle\ActivityListBundle\Migration\ActivityListMigration
  > Oro\Bundle\EntityExtendBundle\Migration\UpdateExtendIndicesMigration
  > Oro\Bundle\EntityConfigBundle\Migration\WarmUpEntityConfigCacheMigration
Loading permissions...
  > VIEW
  > CREATE
  > EDIT
  > DELETE
  > ASSIGN
  > CONFIGURE
  > MANAGE_API_KEY
  > TRANSLATE
All configurable permissions successfully loaded into cache.
Removing all previously loaded commands...
Processing command "oro:cron:message-queue:cleanup": setting up schedule..
Processing command "oro:cron:message-queue:consumer_heartbeat_check": setting up schedule..
Processing command "oro:cron:email-body-sync": setting up schedule..
Processing command "oro:cron:definitions:load": Skipping, the command does not implement CronCommandInterface
Processing command "oro:cron:integration:cleanup": setting up schedule..
Processing command "oro:cron:integration:sync": setting up schedule..
Processing command "oro:cron:import-clean-up-storage": setting up schedule..
Processing command "oro:cron:batch:cleanup": setting up schedule..
Processing command "oro:cron:imap-sync": setting up schedule..
Processing command "oro:cron:imap-credential-notifications": setting up schedule..
Processing command "oro:cron:calendar:date": setting up schedule..
Processing command "oro:cron:send-reminders": setting up schedule..
Processing command "oro:cron:marello:po-advice": setting up schedule..
Loading workflow definitions...
  > marello_order_b2c_workflow_1
  > marello_order_b2c_workflow_2
  > marello_refund_workflow
  > marello_return_workflow
  > marello_purchase_order_workflow

Please run command 'oro:translation:load' to load translations.
[info] > process definition: "sync_email_flag_after_changed" - updated
[info] > process definition: "schedule_integration" - updated
[info] > process definition: "clear_user_email_origin_on_deactivation" - updated
[info] > process definition: "clear_imap_email_folder_on_sync_enabled_change" - updated
[info] > process definition: "marello_return_apply_business_rules" - updated
[info] Process definitions configuration updates are stored into database
[info] >> process trigger: clear_imap_email_folder_on_sync_enabled_change [update] - updated
[info] >> process trigger: clear_user_email_origin_on_deactivation [update] - updated
[info] >> process trigger: marello_return_apply_business_rules [create] - updated
[info] >> process trigger: schedule_integration [update] - updated
[info] >> process trigger: schedule_integration [create] - updated
[info] >> process trigger: sync_email_flag_after_changed [update] - updated
[info] >> process triggers modifications stored in DB
Loading "main" data fixtures ...
  > loading Marello\Bundle\InvoiceBundle\Migrations\Data\ORM\UpdateCurrentInvoiceItemsWithOrganization
  > loading Marello\Bundle\ReturnBundle\Migrations\Data\ORM\UpdateCurrentReturnItemsWithOrganization
  > loading Marello\Bundle\RefundBundle\Migrations\Data\ORM\UpdateCurrentRefundItemsWithOrganization
  > loading Marello\Bundle\OrderBundle\Migrations\Data\ORM\UpdateCurrentOrderItemsWithOrganization
  > loading Marello\Bundle\PackingBundle\Migrations\Data\ORM\UpdateCurrentPackingSlipItemsWithOrganization
  > loading Marello\Bundle\PurchaseOrderBundle\Migrations\Data\ORM\UpdateCurrentPurchaseOrderItemsWithOrganization

In AbstractMySQLDriver.php line 79:

  An exception occurred while executing 'SELECT t0.id AS id_1, t0.product_sku
   AS product_sku_2, t0.product_name AS product_name_3, t0.supplier AS suppli
  er_4, t0.ordered_amount AS ordered_amount_5, t0.received_amount AS received
  _amount_6, t0.purchase_price_value AS purchase_price_value_7, t0.row_total
  AS row_total_8, t0.data AS data_9, t0.status AS status_10, t0.created_at AS
   created_at_11, t0.updated_at AS updated_at_12, t0.product_id AS product_id
  _13, t0.order_id AS order_id_14, t0.organization_id AS organization_id_15 F
  ROM marello_purchase_order_item t0 WHERE t0.organization_id IS NULL':

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.organization_id'
   in 'field list'

In PDOConnection.php line 109:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.organization_id'
   in 'field list'

In PDOConnection.php line 107:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.organization_id'
   in 'field list'

oro:migration:data:load [--fixtures-type [FIXTURES-TYPE]] [--dry-run] [--bundles [BUNDLES]] [--exclude [EXCLUDE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--disabled-listeners DISABLED-LISTENERS] [--current-user CURRENT-USER] [--current-organization CURRENT-ORGANIZATION] [--] <command>

What am I missing?

24198 commented 5 years ago

Hi @Vinai,

Thanks for reporting! I have not yet found the time to reproduce the issue, but we will in the upcoming days. From what I can see in the error messages and the code, is that a migration should have either been there or been executed when updating the application, but it hasn't. So now it tries to set a organization in a column that literally doesn't exist. We will need try and reproduce the error in order to verify the above theory.

Thanks again for reporting!

Kind Regards,

Jaimy

24198 commented 5 years ago

Hi @Vinai,

We've been able to reproduce the issue and have found the cause of it. One of the merges of our mono repo didn't go according to plan and excluded some changes. We are working on a fix now which will include both the versions of the migrations so it will not have an issue anymore.

Thanks again for reporting, we'll keep you updated!

Kind Regards,

Jaimy