10.2.100 Upgrade Data Model Error


(Aaron Willett) #1

I’m working on upgrading our database on our sandbox server from 10.1.500 to 10.2.100 and received an error on the last step (3000 Data Model Regen). I tried manually regenerating it per the instructions, but I receive the same error. Has anyone seen this one?

Here’s the info from the log it references:

Start time: 3/21/2018 7:09:42 AM
Database server: TESTE9MAIN
Database name: 101500
Using Windows authentication: True
User ID: ELKAY\epicor1
Schemas to include:
Tables to exclude: Ice.SysSequence, Ice.DBMigrationLog
Generator version: 3.2.100.0
Server version: 3.2.100.0
Folder C:\Users\epicor1\AppData\Local\Temp\2\Epicor\DataModelGenerator\Source is deleted successfully.
Extracting “Epicor.ServiceModel.dll” from “C:\Program Files (x86)\Common Files\Epicor Software\Database Manager Extensions\3.2.100\DataModelGenerator…\DbMigration.zip” to “C:\Users\epicor1\AppData\Local\Temp\2\Epicor\DataModelGenerator\Deployment\Server\Bin”.
Extracting “Epicor.System.dll” from “C:\Program Files (x86)\Common Files\Epicor Software\Database Manager Extensions\3.2.100\DataModelGenerator…\DbMigration.zip” to “C:\Users\epicor1\AppData\Local\Temp\2\Epicor\DataModelGenerator\Deployment\Server\Bin”.
Extracting “EntityFramework.dll” from “C:\Program Files (x86)\Common Files\Epicor Software\Database Manager Extensions\3.2.100\DataModelGenerator…\DbMigration.zip” to “C:\Users\epicor1\AppData\Local\Temp\2\Epicor\DataModelGenerator\Deployment\Server\Assemblies”.
Synchronizing schema changes.
Generating: C:\Users\epicor1\AppData\Local\Temp\2\Epicor\DataModelGenerator\Source\Server\Db\Ice.Data.Model\IceContext.edmx
Connecting to server/database: TESTE9MAIN/101500
connection opened and DB info retrieved. (61.25 s)
Generate EDMX
generate EDMX completed. (0.24 s)
Process Extended Tables
process of extended tables completed. (0.05 s)
Saving EDMX
save completed. (0.09 s)
Transform Model T4 template
transformation completed. (10.21 s)
Transform TempRowTypes T4 template
transformation of TempRowTypes completed. (0.84 s)
Build context project
build project completed. (15.36 s)
Total generation time (88.05 s)
Copying generated assembly to database: C:\Users\epicor1\AppData\Local\Temp\2\Epicor\DataModelGenerator\Source\Server\Db\Ice.Data.Model\obj\Release\Ice.Data.Model.dll
Generating: C:\Users\epicor1\AppData\Local\Temp\2\Epicor\DataModelGenerator\Source\Server\Db\Erp.Data.910100\ErpContext.edmx
Connecting to server/database: TESTE9MAIN/101500
connection opened and DB info retrieved. (398.04 s)
Generate EDMX
generate EDMX completed. (0.86 s)
Process Extended Tables
process of extended tables completed. (0.35 s)
Saving EDMX
save completed. (0.45 s)
Transform Model T4 template
Error Generating the Data Models: The parameterized query '(@SchemaName nvarchar(4000),@TableName nvarchar(14),@ColumnName ’ expects the parameter ‘@SchemaName’, which was not supplied.


(Bart Elia) #2

That smells like an old version plugin is being used, not the current one:

e.g. - The Data Model Generator has a plugin model. Based upon the version you are using, different code is executed:

I think we added that param some time ago so some I would have assumed there in 10.1.500 even. Something odd to review with a support call


(Aaron Willett) #3

I have a quite a few of those. Should I maybe try deleting/moving the old folders?
I’ll bring this up with support when someone is assigned the call.


(Bart Elia) #4

They SHOULD be vectored to when you open the AC so SHOULDN’T be an issues. I am worried not finding why now will cause issues late (Unless somehow the wrong version dlls got copied into the wrong folder at some point.

If you don’t need to talk to those versions you don’t NEED them unless I am missing something in the minutiae. Support call is best bet as they may have a KB on something I don’t remember or they found after I was done in that area. That framework branch was Sept 2015 for me so getting a few cobwebs on it in my brain :wink:


(Aaron Willett) #5

Looks like the issue is tied to problem PRB0192191 with no work around. :confused:
I guess I won’t be upgrading any time soon.


(Bart Elia) #6

I show that issue as under investigation with no known workaround TODAY - (pre investigation). Sorry if there is a miscommunication but that is in my teams queue to investigate so it caught my eye :wink:


(Nikhil Patwa) #7

Is this an in-place upgrade or you have a separate system (preferably a VM) setup with ERP 10.2.100.x for the upgrade?
We always have a separate VM setup for upgrade since that is clean and updated with the latest ERP version, this way there are no remnants of older versions in the system.


(Aaron Willett) #8

It’s a separate sandbox VM.
We move over a copy of the 10.1.500 from live and then practice the upgrade.


(Aaron Willett) #9

@Bart_Elia, just as a data point for your team, I tried doing a step upgrade: from 10.1.500.16 to 10.1.600.0 and then from 10.1.600 to 10.2.100.0. The upgrade from 10.1.500 to 10.1.600 works just fine through the whole process. The upgrade from 10.1.600 to 10.2.100 generates the same error during the data model regen, however.

Also, 10.2.200 fails with the same issue.


(Haso Keric) #10

I went from 10.1.500.31 to 10.2.100.12 without a problem. FYI.


(Han J Kang) #11

We also encountered this same “schema” error trying to upgrade from 10.1.400 to 10.2.100 (and 10.2.200). Any assistance would be greatly appreciated.


(Aaron Willett) #12

I don’t have anything to offer you just yet. I’m still waiting for the dev team to find a solution.
It’s attached to this problem case if you want to follow it: PRB0192191


(Santiago Palacios) #13

I’ve identified the issue and a fix is in process. In the meantime I can offer a workaround.
The issue occurs when this specific set of conditions is met:

  1. Customer has created a view.
  2. The view contains a date/datetime column
  3. The view is in an Epicor schema name (for example Erp).

To find any such views, you can use this query:

select t.TABLE_SCHEMA, t.TABLE_NAME
from information_schema.Tables t
where t.TABLE_TYPE = ‘VIEW’
and t.TABLE_SCHEMA <> ‘dbo’
and exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS c WHERE c.TABLE_SCHEMA = t.TABLE_SCHEMA and c.TABLE_NAME = t.TABLE_NAME and c.DATA_TYPE like ‘%date%’)

Until this is fixed, you can exclude those views from the DM generation by changing this file:
C:\Program Files (x86)\Common Files\Epicor Software\Database Manager Extensions\3.2.200\DataModelGenerator\Ice.Tool.DataModelGenerator.UI.exe.config

Append the affected views to the ignore list. For example:

Ice.SysSequence,Ice.DBMigrationLog,Erp.MyViewWithADateColumn


(Bart Elia) #14

Ok, circling around on this one…First, my apologies on the delay.

It looks like a view was probably added to the Epicor database. We can work around this if you need the view by the above mentioned work around.

The data model generator will pick up everything in the db unless you tell it not to include tables and views in the datamodel. If you do want them included into the data model, you have to adhere to some design guidelines we provide in the SDK - that’s the validation errors that were shown. We run into this from time to time when a partner wants to add their content alongside of the ERP content for example.

The details on which table or view has issues should be in the logs behind the generator but I think we can do better displaying all that to folks so I’ll see what we can visualize to make the error more obvious.

Let us (and @aidacra) know if you need further assistance.


(Aaron Willett) #15

@Epic_Santiago, @aidacra, @Bart_Elia You guys rock! I will try this out ASAP. Thanks for all your hard work tracking it down.

So–I ran the SQL query and it did not come back with any results.
I found 2 Erp.* views and I excluded both of them, but I still received the same error.
We have a number of dbo.* views–do those need to be excluded as well?


(Santiago Palacios) #16

No, the dbo schema is not included in the DM regen. Can you post your log file or at least the section after the “Error Generating the Data Models:” string?


(Aaron Willett) #17

Here’s the log:

DataModelLog.txt (23.2 KB)


(Nathan your friendly neighborhood Support Engineer) #18

For science, in your test database can you delete the views in question in the Erp schema you can script them to clipboard/query window in SSMS so you can add them back afterwards), then rerun the regen data model?. Does that work? If so, add the views back.

NOTE: if this works, it’s likely an issue with C:\Program Files (x86)\Common Files\Epicor Software\Database Manager Extensions\3.2.200\DataModelGenerator\Ice.Tool.DataModelGenerator.UI.exe.config and how the views were added to the .config file. Case matters for the schema and object name :confused:


(Aaron Willett) #19

It worked!

Case matters for the schema and object name

I typed it in exactly as it was shown in SSMS.


(Nathan your friendly neighborhood Support Engineer) #20

Did you have a space between the comma and the next object? This list cannot have spaces after the comma separator