Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: MigrateDeviceModelCommands throws an exception #1988

Closed
Metal-Mighty opened this issue Apr 4, 2023 · 2 comments
Closed

Bug: MigrateDeviceModelCommands throws an exception #1988

Metal-Mighty opened this issue Apr 4, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Metal-Mighty
Copy link
Contributor

Metal-Mighty commented Apr 4, 2023

Expected Behavior

We are migrating from v2.8.0 to the current latest release v4.8.0, the data from the Storage Account's tables should be migrated to the database.

Current Behavior

During the PgSql initialization, there is an error during the migration of commands

Steps to Reproduce

  • Instantiate a Portal in version 2.8.0
  • Add models and commands
  • Update the image to 4.8.1
  • Observe the world as it collapses

Context (Environment)

Portal version: 4.8.1 (migrating from 2.8.0)
LoRaWAN Stack version: N/A

Logs

[...] PgSql tables init [...]
2023-04-04T12:17:28.165472599Z Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
2023-04-04T12:17:28.165512100Z    at AzureIoTHub.Portal.Infrastructure.Seeds.DeviceModelCommandSeeder.MigrateDeviceModelCommands(PortalDbContext ctx, ConfigHandler config) in /src/AzureIoTHub.Portal.Infrastructure/Seeds/DeviceModelCommandSeeder.cs:line 28
2023-04-04T12:17:28.165518600Z    at AzureIoTHub.Portal.Server.Startup.EnsureDatabaseCreatedAndUpToDate(IApplicationBuilder app) in /src/AzureIoTHub.Portal.Server/Startup.cs:line 471
2023-04-04T12:17:28.165522100Z    at AzureIoTHub.Portal.Server.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in /src/AzureIoTHub.Portal.Server/Startup.cs:line 433
2023-04-04T12:17:28.165525400Z    at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
2023-04-04T12:17:28.165529500Z    at System.Threading.ThreadPoolWorkQueue.Dispatch()
2023-04-04T12:17:28.165532500Z    at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

Additional Information

Our Storage Account table doesn't have any Name column, which may explain the NullReferenceException. All other columns exist and there is no null value.

image

@Metal-Mighty Metal-Mighty added the bug Something isn't working label Apr 4, 2023
@github-project-automation github-project-automation bot moved this to 📝 Todo in IoT Hub Portal Apr 4, 2023
@kbeaugrand kbeaugrand self-assigned this Apr 5, 2023
@kbeaugrand kbeaugrand moved this from 📝 Todo to 🚀 Ready in IoT Hub Portal Apr 5, 2023
@kbeaugrand
Copy link
Member

@Metal-Mighty new release has been created: v4.8.2. could you try it ?

@Metal-Mighty
Copy link
Contributor Author

DB creation ok with v4.8.2, thank you !

@kbeaugrand kbeaugrand linked a pull request Jun 19, 2023 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🚀 Ready
Development

Successfully merging a pull request may close this issue.

2 participants