Issues with RethinkDB Example Using Volumes

Trying to follow the steps here to create a local RethinkDB instance. Now I was able to get things up and running as mentioned in the link, but I wanted to configure it with a volume for the data. Upon configuring properly and running received errors and the container stops pretty immediately after startup.

Expected behavior

Should be able to run a rethinkDB container using volumes

Actual behavior

Container stops as soon as it is started. Errors below.

Information

warn: Parent directory of log file (/data/rethinkdb_data/log_file) could not be synced. (Invalid argument)
Running rethinkdb 2.3.2~0jessie (GCC 4.9.2)...
Running on Linux 4.4.11-moby x86_64
Loading data from directory /data/rethinkdb_data
Version: rethinkdb 2.3.2~0jessie (GCC 4.9.2)
error: Inaccessible database file: "/data/rethinkdb_data/metadata": No such file or directory
       Some possible reasons:
       - the database file couldn't be created or opened for reading and writing
       - the user which was used to start the database is not an owner of the file
warn: Parent directory of log file (/data/rethinkdb_data/log_file) could not be synced. (Invalid argument)
Recursively removing directory /data/rethinkdb_data/tmp
warn: Failed to sync parent directory of "/data/rethinkdb_data/tmp" (errno: 22 - Invalid argument). You may encounter data loss in case of a system failure. (Is the file located on a filesystem that doesn't support directory sync? e.g. VirtualBox shared folders)
Initializing directory /data/rethinkdb_data
Running rethinkdb 2.3.2~0jessie (GCC 4.9.2)...
Running on Linux 4.4.11-moby x86_64
Loading data from directory /data/rethinkdb_data
warn: Failed to sync parent directory of "/data/rethinkdb_data/tmp/metadata.create" (errno: 22 - Invalid argument). You may encounter data loss in case of a system failure. (Is the file located on a filesystem that doesn't support directory sync? e.g. VirtualBox shared folders)
warn: Failed to sync parent directory of "/data/rethinkdb_data/tmp/metadata.create" (errno: 22 - Invalid argument). You may encounter data loss in case of a system failure. (Is the file located on a filesystem that doesn't support directory sync? e.g. VirtualBox shared folders)
Version: rethinkdb 2.3.2~0jessie (GCC 4.9.2)
error: Error in src/serializer/log/log_serializer.cc at line 81:
error: Could not rename database file /data/rethinkdb_data/tmp/metadata.create to permanent location /data/rethinkdb_data/metadata (Device or resource busy)
error: Backtrace:
error: Thu May 26 20:36:52 2016

       1 [0xae4770]: backtrace_t::backtrace_t() at 0xae4770 (rethinkdb)
       2 [0xae4ae9]: format_backtrace(bool) at 0xae4ae9 (rethinkdb)
       3 [0xd9a713]: report_fatal_error(char const*, int, char const*, ...) at 0xd9a713 (rethinkdb)
       4 [0xab5e95]: filepath_file_opener_t::move_serializer_file_to_permanent_location() at 0xab5e95 (rethinkdb)
       5 [0xd358a2]: metadata_file_t::metadata_file_t(io_backender_t*, base_path_t const&, perfmon_collection_t*, std::function<void (metadata_file_t::write_txn_t*, signal_t*)> const&, signal_t*) at 0xd358a2 (rethinkdb)
       6 [0xc60496]: run_rethinkdb_serve(base_path_t const&, serve_info_t*, std::string const&, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> > const&, server_id_t const*, server_config_versioned_t const*, cluster_semilattice_metadata_t const*, directory_lock_t*, bool*) at 0xc60496 (rethinkdb)
       7 [0xc6170c]: run_rethinkdb_porcelain(base_path_t const&, name_string_t const&, std::set<name_string_t, std::less<name_string_t>, std::allocator<name_string_t> > const&, std::string const&, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> > const&, bool, serve_info_t*, directory_lock_t*, bool*) at 0xc6170c (rethinkdb)
       8 [0xc61f7d]: std::_Function_handler<void (), std::_Bind<void (*(base_path_t, name_string_t, std::set<name_string_t, std::less<name_string_t>, std::allocator<name_string_t> >, std::string, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> >, bool, serve_info_t*, directory_lock_t*, bool*))(base_path_t const&, name_string_t const&, std::set<name_string_t, std::less<name_string_t>, std::allocator<name_string_t> > const&, std::string const&, file_direct_io_mode_t, int, boost::optional<boost::optional<unsigned long> > const&, bool, serve_info_t*, directory_lock_t*, bool*)> >::_M_invoke(std::_Any_data const&) at 0xc61f7d (rethinkdb)
       9 [0x9ec491]: starter_t::run_wrapper(std::function<void ()> const&) at 0x9ec491 (rethinkdb)
       10 [0x9f0777]: coro_t::run() at 0x9f0777 (rethinkdb)
error: Exiting.
  • Windows 10
  • Docker Version 1.11.1-beta13 (build: 3441)

Steps to reproduce the behavior

  1. docker create -v /c/Users/admin/docker/rethinkDB:/data --name rethinkDV rethinkdb
  2. docker run --name some-rethink -p 7777:8080 --volumes-from rethinkDV rethinkdb

I can add that the same steps (with the obvious substitution of the proper path) being run with the Docker for Mac Beta work like a charm.

Same issue on Windows 10 with Docker Version 1.12.0-stable (build: 5968)

EDIT: I grabbed the Windows exe for rethinkdb and ran it outside the container to initialize the data folder. Then, I mounted it on the container and it starts successfully. Haven’t really tested it out to see if there are any more issues, but I at least got around this specific problem.

1 Like

Thanks @jmtrue , had the same issue when trying to run RethinkDB using Docker Compose on Windows.

Work around:
Edit - Actually the workaround doesn’t work :confused: It causes problems on database changes.

BTW, the new release saves database data to /rethinkdb_data folder inside the container, not /data.


I just ended creating volume to the docker-machine filesystem without Windows volume.
Using Virtualbox & docker-machine.