jonas
Hi,
I developed a small program that uses ecto + ecto_sqlite3 and as a nested dependency exqlite.
The program works fine when I execute it with mix run, but when I try to compile it to an escript fails to run.
It crashes right at the startup with the following warning + error messages:
13:22:19.172 [warn] The on_load function for module Elixir.Exqlite.Sqlite3NIF returned:
{:function_clause,
[
{:filename, :join, [{:error, :bad_name}, 'sqlite3_nif'],
[file: 'filename.erl', line: 454]},
{Exqlite.Sqlite3NIF, :load_nifs, 0,
[file: 'lib/exqlite/sqlite3_nif.ex', line: 14]},
{:code_server, :"-handle_on_load/5-fun-0-", 1,
[file: 'code_server.erl', ...]}
]}
13:22:19.211 [debug] Websocket connection up on worker #PID<0.231.0>
13:22:19.169 [error] Process #PID<0.296.0> raised an exception
** (FunctionClauseError) no function clause matching in :filename.join/2
(stdlib 3.15.1) filename.erl:454: :filename.join({:error, :bad_name}, 'sqlite3_nif')
(exqlite 0.6.1) lib/exqlite/sqlite3_nif.ex:14: Exqlite.Sqlite3NIF.load_nifs/0
(kernel 8.0.1) code_server.erl:1317: anonymous fn/1 in :code_server.handle_on_load/5
13:22:19.204 [error] GenServer #PID<0.286.0> terminating
** (RuntimeError) connect raised UndefinedFunctionError exception. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
(exqlite 0.6.1) Exqlite.Sqlite3NIF.open/1
(exqlite 0.6.1) lib/exqlite/connection.ex:402: Exqlite.Connection.do_connect/2
(db_connection 2.4.0) lib/db_connection/connection.ex:82: DBConnection.Connection.connect/2
(connection 1.1.0) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.15.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Exqlite.Connection
It ‘may’ be relate to a warning that is logged during compilation of the exqlite dependency:
In file included from /usr/include/string.h:494:0,
from sqlite3/sqlite3.c:14232:
In function ‘memcpy’,
inlined from ‘rbuGetUpdateStmt.constprop’ at sqlite3/sqlite3.c:201606:5,
inlined from ‘rbuStep’ at sqlite3/sqlite3.c:202418:7,
inlined from ‘sqlite3rbu_step’ at sqlite3/sqlite3.c:202651:24:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin_memcpy’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Has anyone ever encountered similar problems with exqlite?
Since it works fine when it’s executed with mix run, might it be related to some incompatibility related to WSL2? Or could it be another reason entirely?
Thanks in advance.
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
How Can I Optimise Compile Time Dependencies
I have been building an elixir application for about 2 years now. Many modules and files ha...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kevinlang
Hey,
The root error is:
Which comes from the line of code where we load our NIF:
It looks like this is because the
priv/directory is not supproted in escript.https://github.com/elixir-lang/elixir/issues/5444
It looks like NIFs in general cannot work in escript. Bummer.
jonas
Thank you very much for the response and the detailed explanation
That is indeed a bummer. Escript seemed like a good idea to deploy a small elixir program.
kevinlang
I haven’t used this, but this may do what you want:
https://github.com/bake-bake-bake/bakeware
I think this is the OTP issue for enabling the functionality natively, but I wouldn’t count on it being implemented anytime soon:
https://github.com/erlang/otp/issues/4476