-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Error after adding authentication #1102
Comments
@Mimetis any idea what the error is? Sample app with No Authentication - It works perfectly with the same database that is provisioned with no authentication. |
No Idea |
Hi @Mimetis [HelloWebAuthSyncClient.zip] |
plz create a github repository |
Hi @Mimetis github.com/sojan1/Dotmim.Sync.Samples |
Please create a repository with your sample only. |
Hi i have removed all other samples and uploaded again |
link is not working |
i am so sorry for that. |
@Mimetis , Hi, have you had a chance to see the error? |
In the sample you provided, you forgot to add tables to your SyncSetup instance: // [Required]: Get a connection string to your server data source
var connectionString = Configuration.GetSection("ConnectionStrings")["SqlConnection"];
// Set the web server Options
var options = new SyncOptions
{
BatchDirectory = Path.Combine(SyncOptions.GetDefaultUserBatchDirectory(), "server")
};
// ADD TABLES !!!!!!!!!!!!!!!!!!!!
var setup = new SyncSetup();
// ADD
var provider = new SqlSyncChangeTrackingProvider(connectionString);
services.AddSyncServer(provider, setup, options, null); Before testing, be sure you are using a fresh server / client database Last thing, your sample is not running correctly and is not raising the issue you are mentionning. |
provisioning is already done for the database. So should i again have the tables added in the SyncSetup(). |
Hi
It fails after sync reaches 100% and it says UNIQUE constraint failed Is this related to #974 , #907?
I am using the sample application (HelloWebAuthSync).
Hub Database - SQL Server
Client Database -SQLite
i tried from both console application and MAUI. it both shows the same error.
Authentication works well, as i tested it by giving a 'key' different from that of server. and it responds 'unauthorised'
i have also tried [AllowAnonymous] on server still the error is the same.
Error: Dotmim.Sync.SyncException: '[InternalSaveScopeInfoClientAsync]..SQLite Error 19: UNIQUE constraint failed: scope_info_client.sync_scope_id, scope_info_client.sync_scope_name, scope_info_client.sync_scope_hash'.'
Same scope 'v0' synchronizes through a different port (81) [ Sample WebApi with NoAuth under MAUI folder].
![image](https://private-user-images.githubusercontent.com/111710684/267814837-b27f28c6-8036-47fe-b876-3c08c6862392.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxMjI5MDEsIm5iZiI6MTcyNDEyMjYwMSwicGF0aCI6Ii8xMTE3MTA2ODQvMjY3ODE0ODM3LWIyN2YyOGM2LTgwMzYtNDdmZS1iODc2LTNjMDhjNjg2MjM5Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMFQwMjU2NDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYTBmNWM0MDYxMGJhOTQxZjkwNGY2Mzk2OTU5MzFjZmU4MjM3MDgwZmU1MGEzYmI5NDdlMjljY2Y2OTI2OTRlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7ovMDEz67EvDh_eF6SgQDBXrXCyROjvLVVfr9Z8-9VA)
Client
private static async Task SynchronizeAsync()
{
string clientConnectionString = $"Data Source=C:\Users\sojan.GEROC\Documents\Projects\Dotmim.Sync-master\Samples\HelloWebAuthSync\HelloWebAuthSyncClient\CoreDatabase.db";
Server
The text was updated successfully, but these errors were encountered: