get property 'attributes' of non-object

[Processing][delta] Step #7 migration completed with 82 Sales Rules;
………………………
[Processing][delta] Step #7 migration completed with 16 Sales Order Statuses;
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/html/preprod/Step7Controller.php at line 1981
#0 /var/www/html/preprod/Step7Controller.php(1574): Step7Controller->_migrateSalesQuoteAddress()
#1 /var/www/html/preprod/Step7Controller.php(1427): Step7Controller->_migrateSalesQuote()
#2 /var/www/html/preprod/Step7Controller.php(253): Step7Controller->_migrateSalesOrders()
#3 /var/www/html/preprod/pub/ub-tool/protected/commands/RunCommand.php(68): Step7Controller->actionRun()
#4 /var/www/html/preprod/pub/ub-tool/protected/commands/RunCommand.php(30): RunCommand->_migrateData()
#5 unknown(0): RunCommand->actionIndex()
#6 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#7 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#8 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#9 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#10 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#11 /var/www/html/preprod/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#12 /var/www/html/preprod/bin/ubdatamigration(4): require_once()

We got this error on sales delta mmigration

20 answers

Profile photo of Mall Staff 184060.00 $tone September 17, 2019
Public

Hi there,

……….PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/html/preprod/Step7Controller.php at line 1981

Let try with steps below:
+ Run below CLI command:
php -f bin/ubdatamigration clean --step=7
+ Once done, clean the cache of our migration tool by run command: 
rm -rf pub/ub-tool/protected/runtime/cache/
+ And then, continue with data migration in step #7
Regards,
Mall.

#1
Profile photo of Mag M 790.00 $tone September 17, 2019
Public

Agaain we got same kind error
 
[Processing][delta] Step #7 migration completed with 82 Sales Rules;
………………………
[Processing][delta] Step #7 migration completed with 16 Sales Order Statuses;
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/html/preprod/Step7Controller.php at line 1981
#0 /var/www/html/preprod/Step7Controller.php(1574): Step7Controller->_migrateSalesQuoteAddress()
#1 /var/www/html/preprod/Step7Controller.php(1427): Step7Controller->_migrateSalesQuote()
#2 /var/www/html/preprod/Step7Controller.php(253): Step7Controller->_migrateSalesOrders()
#3 /var/www/html/preprod/pub/ub-tool/protected/commands/RunCommand.php(68): Step7Controller->actionRun()
#4 /var/www/html/preprod/pub/ub-tool/protected/commands/RunCommand.php(30): RunCommand->_migrateData()
#5 unknown(0): RunCommand->actionIndex()
#6 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#7 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#8 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#9 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#10 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#11 /var/www/html/preprod/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#12 /var/www/html/preprod/bin/ubdatamigration(4): require_once()

#4
Profile photo of Mall Staff 184060.00 $tone September 18, 2019
Public

Hi there,

Agaain we got same kind error

Did you perform all steps as suggested in my reply #1?

If you did and the issue you mentioned still persists, please provide me info of your instance:

  • URL and Admin credentials of your M2 instance
  • SSH credentials of your M2 instance
  • Let us know the path to your M2 folder

I will help to check further and get back to you then.

Regards,
Mall.

#5
Profile photo of Mall Staff 184060.00 $tone September 19, 2019
Public

Hi there,

I checked your instance, but I didn’t see the issue you mentioned when running the data migration in step #7:

PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/html/preprod/Step7Controller.php at line 1981

However, I got the issue below:

[Processing][run] in step #7: ……..
Status: fail
Message: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘1’ for key ‘PRIMARY’. The SQL statement executed was: INSERT INTO `sales_invoice_comment` (`is_visible_on_front`, `entity_id`, `parent_id`, `is_customer_notified`, `comment`, `created_at`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)

 
After checking further into your M2 database, I saw you had a lot of sales data:
http://prntscr.com/p837go
http://prntscr.com/p837tz

Meanwhile, you had checked the ‘KEEP ORIGINAL IDs’ setting in step #7 of our migration tool which in return caused the duplicated entry issue as above. 

Please note that if you want to keep original Ids when migrating sales data, your M2 database must be a fresh instance.
 
So, you have to reset step #7 and then delete all sales data in your M2 database. Then, you can do data migration in step #7 with the ‘KEEP ORIGINAL IDs’ setting. 

In case you need to keep current sales data in your M2 database, you must reset step #7 and then, uncheck the ‘KEEP ORIGINAL IDs’ setting in step #7 of our migration tool. Once done, you can run data migration in this step.
 
PS. As explained above, you did enable ‘Keep Original IDs’ option while adding new data after the first migration, this caused many duplicated issues so far. Please consider to upgrade the migration tool to the latest Pro ver 3.2.1. This might help to reduce the possibility of the duplicated issue. 

Regards,
Mall.
 

#7
Profile photo of Mag M 790.00 $tone September 19, 2019
Public

 Well we are doing DELTA migration and we have not placed any orders, so I don’t think that should create problem.
In delta migration also we want to keep original ids.

Please explain clearly what needs to be done.
We migrated everything before and now we only want delta migration for sales and customers, keeping the original ids.
Help us with proper steps.

Just to be clear we export live m1 database and then do migration or delta migration

#8
Profile photo of Mall Staff 184060.00 $tone September 19, 2019
Public

Hi there,

and we have not placed any orders

But from the issue I mentioned, it indicated that you had added more sales invoice comment, sales shipment tracking… in your M2 after the first migration was complete.

To continue with the Keep original ids, you can do steps below:
+ Upgrade our migration tool to the latest Pro version 3.2.1
+ Once done, run the delta migration in step #6, #7 by running the CLI commands:
php -f bin/ubdatamigration run --step=6 --mode=update
php -f bin/ubdatamigration run --step=7 --mode=update
 
If you still get any error message like ‘duplicate ids…’, please help to quote the details of the error message so that I can check further and provide you workaround.
(I will work closely with you on case by case though). 

Regards,
Mall.

#9
Profile photo of Mag M 790.00 $tone September 20, 2019
Public

Hi Mall,
 
Its streesful, so here is what we have decided, we will take m2 data migrated database and the codebase associated to it,   take a new export of m1 database create this setup on a new environment.We provide all details, you first check the data, and lead this delta migration.

Its better if we are connected via skype, zoom to make this process faster

#10
Profile photo of ubdev Staff 98150.00 $tone September 20, 2019
Public

Hi there, 
Please follow the specific steps in the reply #9 suggested by our team member Mall. 

 + Upgrade our migration tool to the latest Pro version 3.2.1

We highly recommend you follow this direction. If you can not do this, please let us know the reason. 

Its better if we are connected via skype, zoom to make this process faster

We’re afraid we provide technical support via this helpdesk only. Due to our current high workload, we could not provide instant or near-real-time response. We will try our best to provide you response as soon as possible though.
Regards,
Ubertheme team

#11
Profile photo of Mag M 790.00 $tone September 20, 2019
Public

[Processing][delta] Step #7 migration completed with 16 Sales Order Statuses;
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/html/preprod/Step7Controller.php at line 1981
#0 /var/www/html/preprod/Step7Controller.php(1574): Step7Controller->_migrateSalesQuoteAddress()
#1 /var/www/html/preprod/Step7Controller.php(1427): Step7Controller->_migrateSalesQuote()
#2 /var/www/html/preprod/Step7Controller.php(253): Step7Controller->_migrateSalesOrders()
#3 /var/www/html/preprod/pub/ub-tool/protected/commands/RunCommand.php(74): Step7Controller->actionRun()
#4 /var/www/html/preprod/pub/ub-tool/protected/commands/RunCommand.php(33): RunCommand->_migrateData()
#5 unknown(0): RunCommand->actionIndex()
#6 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#7 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#8 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#9 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#10 /var/www/html/preprod/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#11 /var/www/html/preprod/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#12 /var/www/html/preprod/bin/ubdatamigration(4): require_once()

Can you help to find and delete the attribute that is getting called and throwing error first ?

#12
Profile photo of Mall Staff 184060.00 $tone September 20, 2019
Public

Hi there,

PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/html/preprod/Step7Controller.php at line 1981
#0 /var/www/html/preprod/Step7Controller.php(1574): Step7Controller->_migrateSalesQuoteAddress()

To solve that issue, please try steps below:

+ Run the following CLI command:
php -f bin/ubdatamigration clean --step=7
+ And then clean cache of our migration tool by running the command:
rm -rf  /var/www/html/preprod/pub/ub-tool/protected/runtime/cache
+ Once done, continue with the data migration in step #7:
php -f bin/ubdatamigration run --step=7;

Regards,
Mall.
 

#13
Profile photo of energycell 920.00 $tone May 5, 2021
Public

@staff I have also tried this and am gettign the same response:
 

[Processing][run] in step #7: ..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................PHP Error[8]: Trying to get property 'attributes' of non-object
in file /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php at line 2013
#0 /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php(1604): Step7Controller->_migrateSalesQuoteAddress()
#1 /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php(1457): Step7Controller->_migrateSalesQuote()
#2 /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php(254): Step7Controller->_migrateSalesOrders()
#3 /var/www/html/pub/ub-tool/protected/commands/RunCommand.php(74): Step7Controller->actionRun()
#4 /var/www/html/pub/ub-tool/protected/commands/RunCommand.php(33): RunCommand->_migrateData()
#5 unknown(0): RunCommand->actionIndex()
#6 /var/www/html/pub/ub-tool/yii-1.1.19/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#7 /var/www/html/pub/ub-tool/yii-1.1.19/console/CConsoleCommandRunner.php(71): RunCommand->run()
#8 /var/www/html/pub/ub-tool/yii-1.1.19/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#9 /var/www/html/pub/ub-tool/yii-1.1.19/base/CApplication.php(185): CConsoleApplication->processRequest()
#10 /var/www/html/pub/ub-tool/yii-1.1.19/yiic.php(33): CConsoleApplication->run()
#11 /var/www/html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#12 /var/www/html/bin/ubdatamigration(4): require_once()
root@JB-M2:/var/www/html# php -f bin/ubdatamigration run --step=7
[Processing][run] in step #7: ..

I have also run these commands:
 
To solve that issue, please try steps below:
+ Run the following CLI command:
php -f bin/ubdatamigration clean --step=7
+ And then clean cache of our migration tool by running the command:
rm -rf /var/www/html/preprod/pub/ub-tool/protected/runtime/cache
+ Once done, continue with the data migration in step #7:
php -f bin/ubdatamigration run --step=7;
 
 
 

#14
Profile photo of ubdev Staff 98150.00 $tone May 5, 2021
Public

Hi Davec, 
It seems you did use an old version of our UB Data Migration Pro module. 
Please consider renewing your subscription to get the latest package v.3.2.6, then re-perform the steps you mentioned: 

+ Run the following CLI command:
php -f bin/ubdatamigration clean --step=7
+ And then clean cache of our migration tool by running the command:
rm -rf /var/www/html/preprod/pub/ub-tool/protected/runtime/cache
+ Once done, continue with the data migration in step #7:
php -f bin/ubdatamigration run --step=7;

PS. For any additional questions you might have, please submit a new ticket, our team will follow up with you then. 
Regards,
Ubertheme team

#15
Profile photo of energycell 920.00 $tone May 5, 2021
Public

Thanks, I’ve just done that and the issue persists. Same issue:
 
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….PHP Error[8]: Trying to get property ‘attributes’ of non-object
in file /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php at line 2239
#0 /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php(1795): Step7Controller->_migrateSalesQuoteAddress()
#1 /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php(1631): Step7Controller->_migrateSalesQuote()
#2 /var/www/html/pub/ub-tool/protected/controllers/Step7Controller.php(310): Step7Controller->_migrateSalesOrders()
#3 /var/www/html/pub/ub-tool/protected/commands/RunCommand.php(80): Step7Controller->actionRun()
#4 /var/www/html/pub/ub-tool/protected/commands/RunCommand.php(36): RunCommand->_migrateData()
#5 unknown(0): RunCommand->actionIndex()
#6 /var/www/html/pub/ub-tool/yii-1.1.22/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()
#7 /var/www/html/pub/ub-tool/yii-1.1.22/console/CConsoleCommandRunner.php(71): RunCommand->run()
#8 /var/www/html/pub/ub-tool/yii-1.1.22/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#9 /var/www/html/pub/ub-tool/yii-1.1.22/base/CApplication.php(185): CConsoleApplication->processRequest()
#10 /var/www/html/pub/ub-tool/yii-1.1.22/yiic.php(33): CConsoleApplication->run()
#11 /var/www/html/pub/ub-tool/protected/ubdatamigration_cli.php(5): require_once()
#12 /var/www/html/bin/ubdatamigration(4): require_once()

#16
Profile photo of ubdev Staff 98150.00 $tone May 5, 2021
Public

Hi Davec,
I am sorry for replying to you this late. 
Mall has replied to you via your new ticket here, please follow up with us there. 
Regards,
Ubertheme team

#18
Profile photo of energycell 920.00 $tone May 6, 2021
Public

In the end, this worked.

Please try the following steps:
1. Run the CLI command:

php -f bin/ubdatamigration rmdeleted --step=7;

2. Next, you run the CLI command:

php -f bin/ubdatamigration clean --step=7;

3. And then, you continue with data migration in step #7 using this CLI command:

php -f bin/ubdatamigration run --step=7;
#19
Profile photo of ubdev Staff 98150.00 $tone May 6, 2021
Public

Hi Davec,
We’re glad that you sorted it out at your end. 
For any additional questions you might have, please help to submit a separate ticket, our team will follow up with you then. 
PS. Meanwhile, we wonder if you are looking for any new theme for your M2 project. If you do, please take a look at our new UB Atoms theme (here) to see if it’s a good fit. For your information, this theme has been revamped and built from the ground up unlike any other themes at Ubertheme so far. 
Regards,
Ubertheme team

#20

Please login or Register to Submit Answer

Written By

Comments