{"record":{"id":"ea5ddaffbf687e94","repo":"tursodatabase/turso","slug":"data-source-is-not-a-remote-turso-url-datasource","errorCode":null,"errorMessage":"Data Source is not a remote Turso URL: {DataSource}","messagePattern":"Data Source is not a remote Turso URL: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoConnectionOptions.cs","lineNumber":63,"sourceCode":"                    nameof(SyncInterval),\n                    value,\n                    $\"Sync Interval must be between 0 and {MaximumSyncIntervalSeconds} seconds.\");\n            }\n\n            return value;\n        }\n    }\n\n    public string SyncClientName => _builder.SyncClientName;\n\n    public int SyncLongPollTimeout => _builder.SyncLongPollTimeout;\n\n    public bool BootstrapIfEmpty => _builder.BootstrapIfEmpty;\n\n    public int PartialBootstrapPrefix => _builder.PartialBootstrapPrefix;\n\n    public string PartialBootstrapQuery => _builder.PartialBootstrapQuery;\n\n    public long PartialSyncSegmentSize => _builder.PartialSyncSegmentSize;\n\n    public bool PartialSyncPrefetch => _builder.PartialSyncPrefetch;\n\n    public string RemoteEncryptionCipher => _builder.RemoteEncryptionCipher;\n\n    public string RemoteEncryptionKey => _builder.RemoteEncryptionKey;\n\n    public long PushOperationsThreshold => _builder.PushOperationsThreshold;\n\n    public long PullBytesThreshold => _builder.PullBytesThreshold;\n\n    public bool ForceLogicalMvccPull => _builder.ForceLogicalMvccPull;\n\n    public string SyncExperimentalFeatures => _builder.SyncExperimentalFeatures;\n\n    public bool? Tls => _builder.Tls;\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/tursodatabase/turso/blob/6c7252267988c76e632af00a671e4b9788dfae13/bindings/dotnet/src/Turso.Data/TursoConnectionOptions.cs#L45-L81","documentation":"Thrown by TursoConnectionOptions.GetRemoteUri() when the 'Data Source' value is not an absolute URI with one of the accepted remote schemes (libsql, http, https, ws, wss). The provider needs a full absolute URL to build the HTTP endpoint for a remote Turso database; local file paths, relative strings, empty values, or other schemes cannot be resolved to a remote endpoint. The message echoes the offending Data Source value so you can see exactly what was parsed.","triggerScenarios":"Calling TursoConnection.Open() (or any remote/replica code path that calls GetRemoteUri()) with Data Source set to a local path like 'app.db' or 'file:app.db', an empty string, a relative URL, a value with surrounding whitespace or quotes, or a scheme outside the allowed set such as 'sqlite://host' or 'libsql-db://host'.","commonSituations":"Copying a Microsoft.Data.Sqlite connection string into a Turso connection; switching a project from a local file database to Turso Cloud without updating Data Source; typos like 'libsql//host' or a missing '://' so the URI is not absolute; per-environment config where one environment points at a local file but the code path assumes remote.","solutions":["Set Data Source to an absolute remote URL with an allowed scheme, e.g. 'Data Source=libsql://my-db-my-org.turso.io'.","If you meant a local database, keep a plain file path and do not use remote/replica features (IsReplica, remote sync paths) with it.","Fix malformed URLs: include '://' (e.g. 'libsql://' not 'libsql:'), and trim stray whitespace or quotes around the value from config/env vars.","Confirm the scheme is exactly one of libsql, http, https, ws, wss."],"exampleFix":"// before\nData Source=app.db   // local path, but the code path calls GetRemoteUri()/replica sync\n\n// after\nData Source=libsql://my-db-my-org.turso.io;Auth Token=eyJhbGciOi...","handlingStrategy":"validation","validationCode":"var options = new TursoConnectionOptions(builder);\nif (!options.IsRemote || !Uri.TryCreate(options.DataSource, UriKind.Absolute, out _))\n    throw new ConfigurationException($\"Data Source must be a remote libsql/http(s)/ws(s) URL, got: {options.DataSource}\");\nawait conn.OpenAsync(ct);","typeGuard":"static bool IsRemoteTursoUrl(string dataSource) =>\n    Uri.TryCreate(dataSource, UriKind.Absolute, out var uri)\n    && uri.Scheme is \"libsql\" or \"http\" or \"https\" or \"ws\" or \"wss\";","tryCatchPattern":"try { await conn.OpenAsync(ct); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"not a remote Turso URL\")) { /* fail fast with config error, do not retry */ }","preventionTips":["Load Data Source from a single config source and validate it at startup with IsRemoteTursoUrl before any connection is opened.","Fail fast at boot on bad config instead of on first query.","Add a config smoke test that opens a connection in CI."],"tags":["csharp","dotnet","connection-string","data-source","url-validation"],"backgroundTag":"invalid-connection-url","analyzedSha":"6c7252267988c76e632af00a671e4b9788dfae13","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}