replaysMike / Binner

Open source parts inventory system for makers, electronics hobby, and professional engineers
https://binner.io
GNU General Public License v3.0
268 stars 41 forks source link

Error with MariaDB provider #134

Closed pdo59 closed 1 year ago

pdo59 commented 1 year ago

I installed Binner in Mac osx with MariaDB storage provider, the Binner DB was created, but when I try to insert a parts this error happens: An unhandled exception has occurred while executing the request. MySqlConnector.MySqlException (0x80004005): Table 'binner.parts' doesn't exist in engine If I try to execute a SELECT * FROM binner.parts; via mysql client there is no error, but obviously the table is empty.

replaysMike commented 1 year ago

just released v2.3.2 which contains updates to the MySql provider. Please let me know if it resolves your issue. I will additionally run another test on the provider to ensure it's working on my test environment.

pdo59 commented 1 year ago

Hi replaysMike, I tried to execute Binner.Web in Debian linux: With MariaDB 10.5.18-MariaDB-0+deb11u1 - Debian 11 I have this error: 2023-03-29 16:34:13.6197|ERROR|Binner.Web.ServiceHost.BinnerWebHostService|Binner had an error starting up!|Binner.Common.BinnerConfigurationException: The database filename specified in the configuration cannot be empty for the BinnerFileStorageProvider storage provider. at Binner.Common.StorageProviders.BinnerFileStorageProvider.ValidateBinnerConfiguration(BinnerFileStorageConfiguration config) in C:\projects\binner\Binner\Library\Binner.Common\StorageProviders\BinnerFileStorageProvider.cs:line 51 at Binner.Common.StorageProviders.BinnerFileStorageProvider..ctor(IDictionary``2 config) in C:\projects\binner\Binner\Library\Binner.Common\StorageProviders\BinnerFileStorageProvider.cs:line 40 at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.ConstructorInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) --- End of stack trace from previous location --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services) at Microsoft.AspNetCore.Hosting.WebHost.EnsureApplicationServices() at Microsoft.AspNetCore.Hosting.WebHost.Initialize() at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at Binner.Web.ServiceHost.BinnerWebHostService.InitializeWebHostAsync() in C:\projects\binner\Binner\Binner.Web\ServiceHost\BinnerWebHostService.cs:line 133 Same error with PostgreSQL PostgreSQL 13.9 (Debian 13.9-0+deb11u1) The only way to make it work is with Binner provider in Debian linux. I also tried the Mac osx version, but the OS is unable to run the Binner.Web app because the file appears to be corrupted. Another question: if I have a previously populated database, can I use the new version of Binner without losing my data? At the moment I tried with a new empty db but later I will have to use the previous database that contains my data. P.S. I tried the Windows version with 10.11.2-MariaDB and it seems to work. But in this case I have a problem using Binner from another PC via lan, perhaps a firewall problem? P.P.S Yes was a firewall problem, solved. In Windows with MariaDB Binner is functioning.

replaysMike commented 1 year ago

can you share with me the contents of your appsettings.json?

That particular error indicates you have set the Provider = "Binner" but the required Filename isn't set. If you wish to use MariaDB then the StorageProviderConfiguration section needs to look like this (with your db username and password set in the connection string):

"StorageProviderConfiguration": {
    // Provider options: Binner, SqlServer, Postgresql, MySql, Sqlite
    "Provider": "MySql",
    "ProviderConfiguration": {
      "ConnectionString": "Server=localhost;Database=Binner;Uid=root;Pwd=password;" // MySql provider
    },
  },

Yes, upgrading should have no effect on your data - you should be able to run any version. Where you might run into a problem is downgrading, only if you are using the "Binner" provider. The database providers won't have this issue (mostly).

Yep, you'll need to open up port 8090 to use it from another PC. If on the same network you'll only need to configure Windows firewall (if Binner is on Windows) to open that up, or iptables/ufw etc on unix environments.

Later today I'll fire up a Debian virtual host and see if I spot any issues with MariaDb. I don't think I've tried it on Debian, most of my previous testing was with Ubuntu on MariaDb 10.11.

replaysMike commented 1 year ago

I should note, if you do run into any data corruption issues with the "Binner" provider, please let me know. It's possible I can recover the data for you if that happens, but I'm not currently aware of any issues. The "Binner" provider is special in that it's a serialized database, so it's very fast, but it's not as flexible as regular database providers.

pdo59 commented 1 year ago

Ok, waiting for your test on Debian, meanwhile I migrated my db and Binner to Windows and everything seems to work fine.

interbiznw commented 1 year ago

@replaysMike is there documentation that im missing on the procedure to switch to mysql?

export, switch to mysql, then import what we exported?

replaysMike commented 1 year ago

Currently there isn't documentation on it specifically (I should do so possibly today) but the procedure is basically what you indicated.

I'm currently working on v2.4 hoping to release within a week, and it will include a backup/restore feature that will fully allow this between data providers. This update is big and is a rewrite of all the storage providers support so I can release features faster