I'm getting the following while trying to run my API built with Dart on the Ubuntu server:
root@veyilserver:~/veyilapi# dart run
Building package executable... (17.7s)
Compilation did not produce any result. Expected file at /root/veyilapi/.dart_tool/pub/bin/veyilapi/tmpCNPJMW/veyilapi.dart-3.3.4.snapshot.incremental.temp
Built veyilapi:veyilapi.
Cannot rename file to '/root/veyilapi/.dart_tool/pub/bin/veyilapi/veyilapi.dart-3.3.4.snapshot', path = '/root/veyilapi/.dart_tool/pub/bin/veyilapi/tmpCNPJMW/veyilapi.dart-3.3.4.snapshot.incremental.temp' (OS Error: No such file or directory, errno = 2)
PathNotFoundException: Cannot rename file to '/root/veyilapi/.dart_tool/pub/bin/veyilapi/veyilapi.dart-3.3.4.snapshot', path = '/root/veyilapi/.dart_tool/pub/bin/veyilapi/tmpCNPJMW/veyilapi.dart-3.3.4.snapshot.incremental.temp' (OS Error: No such file or directory, errno = 2)
Everything was functioning perfectly until I restarted the server yesterday. Now, it's completely broken. I tried uninstalling and reinstalling Dart SDK, also tried using a earlier versions (3.3.0 and 3.0.0) , couldn't get over this one.
Can somebody help with a workaround please?
I'm sorry but I'm kind of not sure if this is an issue with the language or Dart VM.
Here's more info about the server and Dart versions I'm using:
dart info
)Dart 3.3.4 (stable) (None) on "linux_x64"
on linux / Linux 6.5.0-28-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 28 23:46:48 UTC 2024
locale is C.UTF-8
No Dart processes found.
Ubuntu 23.10 x64
name: veyilapi
description: A simple server setup
version: 1.0.0
environment:
sdk: ">=3.0.0"
dependencies:
args: ^2.5.0
shelf: ^1.4.1
shelf_router: ^1.1.4
http: ^1.2.1
dev_dependencies:
lints: ^3.0.0
test: ^1.25.4
Also, when I tried to run dart compile
the following error occurred:
root@veyilserver:~/veyilapi# dart compile exe bin/veyilapi.dart
Error: AOT compilation failed
Generating AOT kernel dill failed!
.dart_tools
and found its empty..dart_tools
and ran dart pub get
.dart pub cache clean
-> dart pub get
-> dart run
After discussing in the Dart Community, finally I was able to get over this issue.
For no good reason, dart compile
with --verbose
flag did work and generated the compiled .exe
file and I was able to start the server without a problem.
Note: The issue persists when I try to run dart compile
or dart run
alone.