Summary of common issues, troubleshooting tools and pointers.
SqliteException: Could not load extension
or similarThis client-side error or similar typically occurs when PowerSync is used in conjunction with either another SQLite library or the standard system SQLite library. PowerSync is generally not compatible with multiple SQLite sources. If another SQLite library exists in your project dependencies, remove it if it is not required. In some cases, there might be other workarounds. For example, in Flutter projects, we’ve seen this issue with sqflite 2.2.6
, but sqflite 2.3.3+1
does not throw the same exception.
Tip: Asking the AI bot on the #gpt-help channel on our Discord server is a good way to troubleshoot common issues.
Troubleshooting techniques depend on the type of issue:
Access the diagnostics app here: https://diagnostics-app.powersync.com
This is a standalone web app that presents data from the perspective of a specific user. It can be used to:
See the Readme for further details.
We also provide diagnostics via an API on the client. Examples include the connection status, last completed sync time, and local upload queue size.
If for example, a change appears to be missing on the client, you can check if the last completed sync time is greater than the time the change occurred.
The JavaScript SDKs (React Native, web) also log the contents of sync bucket changes to console.debug
if verbose logging is enabled. This should log which PUT
/PATCH
/DELETE
operations have been applied from the server.
Another useful debugging tool as a developer is to open the SQLite file and inspect the contents. We share an example of how to do this on iOS from macOS in this video:
Essentially, run the following to grab the SQLite file:
find ~/Library/Developer/CoreSimulator/Devices -name "mydb.sqlite"
find ~/Library/Developer/CoreSimulator/Devices -name "mydb.sqlite"
adb pull data/data/com.mydomain.app/files/mydb.sqlite
Our diagnostics app and several of our demo apps also contain a SQL console view to inspect the local database contents. Consider implementing similar functionality in your app. See a React example here.
Our client SDKs support logging to troubleshoot issues. Here’s how to enable logging in each SDK:
JavaScript-based SDKs (Web, React Native, and Node.js) - You can use our built-in logger based on js-logger for logging. Create the base logger with const logger = createBaseLogger()
and enable with logger.useDefaults()
and set level with logger.setLevel(LogLevel.DEBUG)
. For the Web SDK, you can also enable the debugMode
flag to log SQL queries on Chrome’s Performance timeline.
Flutter SDK - Logging is enabled by default since version 1.1.2 and outputs logs to the console in debug mode.
Kotlin Multiplatform SDK - Uses Kermit Logger. By default shows Warnings
in release and Verbose
in debug mode.
Swift SDK - Supports configurable logging with DefaultLogger
and custom loggers implementing LoggerProtocol
. Supports severity levels: .debug
, .info
, .warn
, and .error
.
.NET SDK - Uses .NET’s ILogger
interface. Configure with LoggerFactory
to enable console logging and set minimum log level.
When running into issues with data sync performance, first review our expected Performance and Limits.
These are some common pointers when it comes to diagnosing and understanding performance issues:
Enabling the debugMode
flag in the Web SDK logs all SQL queries on the Performance timeline in Chrome’s Developer Tools (after recording). This can help identify slow-running queries.
This includes:
This excludes:
powersync-sqlite-core
.Enable this mode when instantiating PowerSyncDatabse
: