Bedrock
Bedrock copied to clipboard
Starting bedrock (via systemctl): bedrock.serviceFailed to start bedrock.service: Unit bedrock.service not found. with installation on Ubuntu 16.04
The result:
sh@sh-ubuntu:~$ sudo apt-get install bedrock
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-36 linux-headers-4.4.0-36-generic linux-image-4.4.0-36-generic linux-image-extra-4.4.0-36-generic linux-signed-image-4.4.0-36-generic linux-tools-4.4.0-36
linux-tools-4.4.0-36-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
bedrock
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
Need to get 2,845 kB of archives.
After this operation, 7,920 kB of additional disk space will be used.
Get:1 https://apt.bedrockdb.com/ubuntu xenial/main amd64 bedrock all 1.0.20~7a4c774 [2,845 kB]
Fetched 2,845 kB in 47s (60.1 kB/s)
Selecting previously unselected package bedrock.
(Reading database ... 309425 files and directories currently installed.)
Preparing to unpack .../bedrock_1.0.20~7a4c774_all.deb ...
Unpacking bedrock (1.0.20~7a4c774) ...
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Setting up bedrock (1.0.20~7a4c774) ...
[....] Starting bedrock (via systemctl): bedrock.serviceFailed to start bedrock.service: Unit bedrock.service not found.
failed!
dpkg: error processing package bedrock (--configure):
subprocess installed post-installation script returned error exit status 5
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
bedrock
E: Sub-process /usr/bin/dpkg returned an error code (1)
Info:
PackageArchitecture: all
ProcVersionSignature: Ubuntu 4.4.0-38.57-generic 4.4.19
RelatedPackageVersions:
dpkg 1.18.4ubuntu1.1
apt 1.2.12~ubuntu16.04.1
Tags: loki third-party-packages
Title: package bedrock 1.0.20~7a4c774 [origin: apt.bedrockdb.com] failed to install/upgrade: subprocess installed post-installation script returned error exit status 5
Uname: Linux 4.4.0-38-generic x86_64
UnreportableReason: This is not an official elementary package. Please remove any third party package and try again.
UpgradeStatus: No upgrade log present (probably fresh install)
_MarkForUpload: True
Can you do service bedrock status
and post the output? It should shed some light on what part of the post install script is failing.
Removed:
sudo apt-get remove --purge bedrock
Installed:
sh@sh-ubuntu:/var/lib$ sudo apt-get install bedrock
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-36 linux-headers-4.4.0-36-generic linux-image-4.4.0-36-generic linux-image-extra-4.4.0-36-generic linux-signed-image-4.4.0-36-generic linux-tools-4.4.0-36
linux-tools-4.4.0-36-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
bedrock
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
Need to get 0 B/2,845 kB of archives.
After this operation, 7,920 kB of additional disk space will be used.
Selecting previously unselected package bedrock.
(Reading database ... 309425 files and directories currently installed.)
Preparing to unpack .../bedrock_1.0.20~7a4c774_all.deb ...
Unpacking bedrock (1.0.20~7a4c774) ...
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up bedrock (1.0.20~7a4c774) ...
[....] Starting bedrock (via systemctl): bedrock.serviceFailed to start bedrock.service: Unit bedrock.service not found.
failed!
dpkg: error processing package bedrock (--configure):
subprocess installed post-installation script returned error exit status 5
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
bedrock
E: Sub-process /usr/bin/dpkg returned an error code (1)
sh@sh-ubuntu:/var/lib$ service bedrock status
● bedrock.service - LSB: Start the Expensify Bedrock jobs/scheduling/cache server.
Loaded: loaded (/etc/init.d/bedrock; bad; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (SQLiteNode.cpp:170) shutdownComplete [write0] [info] {bedrock/SEARCHING} Graceful shutdown is complete
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (BedrockServer.cpp:248) BedrockServer_WorkerThread [write0] [info] Thread exiting
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (SQLite.cpp:105) ~SQLite [write0] [info] {/var/lib/bedrock/bedrock.db} Closing database '/var/lib/bedrock/bedrock.db', commitCount=1
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (libstuff.cpp:2394) SQuery [write0] [dbug] SELECT MAX(id) FROM journal
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (libstuff.cpp:2394) SQuery [write0] [dbug] SELECT hash FROM journal WHERE id=1
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (SQLite.cpp:18) sqliteLogCallback [write0] [info] {SQLITE} Code: 28, Message: file unlinked while open: /var/lib/bedrock/bedrock.db
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (SQLite.cpp:128) ~SQLite [write0] [info] {/var/lib/bedrock/bedrock.db} Database closed.
Oct 19 23:44:55 sh-ubuntu bedrock[7011]: xxxxx (main.cpp:240) main [main] [info] Graceful bedrock shutdown complete
Oct 19 23:44:55 sh-ubuntu bedrock[7925]: ...done.
Oct 19 23:44:55 sh-ubuntu systemd[1]: Stopped LSB: Start the Expensify Bedrock jobs/scheduling/cache server..
This error is happening because we didn't include a systemd unit config for bedrock. We're working on getting one written, should be available soon.
In the meantime, users who get this error should be able to start the app manually from the init script:
sudo /etc/init.d/bedrock start
Hey @righdforsa, @quinthar,
I couldn't find how you build deb package for bedrock, so its not a proper PR per se, but here you go:
https://gist.github.com/qqo/32c26c6f4c24edd1c6aca216275d1b1e
In a nutshell, you can simply add those three files into debian control file and it should just work. The tests I did are also added to gist, and stuff I was concerned about marked as 'todo' in comments. Should also address #24 and #27. The config file is super simple to address the fact that it might be autogenerated, as well as initscript.
Cheers!
Thanks, @qqo ! We haven't included the build script yet, but this is super useful, thanks. Your documentation is very helpful, too!
@righdforsa Can you please figure out how to convert this into a PR and merge it?
We've created a config directory in the repo, so now all we need to do is massage these a bit, test, and do a release.
Reassigning to @coleaeason who should be able to get this done faster.
Just ran into this same issue today and wanted to give this a "bump"