pmiklos / docker-byteball-hub

Docker image for byteball-hub
MIT License
0 stars 0 forks source link

Seems not to work for me. #1

Closed sjamayee closed 7 years ago

sjamayee commented 7 years ago

Hi,

I try to run this container, but without success. When I start it, it looks OK. But when I stop it, I can't start it again.

Because I don't know how to view the logs, I changed the Dockerfile like this:

CMD [ "/bin/sh", "-c", "node /usr/local/lib/node_modules/byteball-hub/start.js >> /byteball/log.txt CMD [ "/bin/sh", "-c", "node /usr/local/lib/node_modules/byteball-hub/start.js" ]

and when I rebuild/run it, I got this error:

wss://byteball.org/bb

failed query: [ 'SELECT json FROM joints WHERE unit=?', [ 'PyfmoWcddZvrQCLvSja9mqT3NNYHrf+Xx+aotr6c0Cs=' ], [Function] ] /usr/local/lib/node_modules/byteball-hub/node_modules/byteballcore/sqlite_pool.js:105 throw Error(err+"\n"+sql+"\n"+new_args[1].join(', ')); ^ Error: Error: SQLITE_ERROR: no such table: joints

pmiklos commented 7 years ago

Yes, indeed. I reported this issue to Tony a while ago. This is what he answered:

forgot to add this table into initial sqlite file you have to add it manually

CREATE TABLE joints (
unit CHAR(44) NOT NULL PRIMARY KEY,
json TEXT NOT NULL,
creation_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

open your database: sqlite3 ~/.config/byteball-hub/byteball.sqlite and execute the SQL

This is how I applied it (I am writing it out of my head, I don't have the exact history)

docker run -it --rm -v byteball-hub:/byteball byteball-hub -u root /bin/ash
# apk add --no-cache --virtual sqlite
# su - byteball
byteball$ sqlite3 ~/.config/byteball-hub/byteball.sqlite

and then apply the script.

It looks like it still hasn't been added to the byteball initial sqlite db.

sjamayee commented 7 years ago

I have checked and "joins" is included in both: byteball-sqlite.sql byteball-sqlite-light.sql in byteballcore and required/used via > relay > hub

When this is correct, it should be there already.

And when I try the above patch, I only see an empty database. I'm not an expert, but that's what I see.

pmiklos commented 7 years ago

No, the initial sqlite file still does not contain the joint table:

:~/git/byteball/byteballcore$ sqlite3 initial.byteball.sqlite
SQLite version 3.8.7.1 2014-10-29 13:59:56
Enter ".help" for usage hints.
sqlite> .tables
address_definition_changes            outputs
addresses                             paid_witness_events
archived_joints                       pairing_secrets
asset_attestors                       parenthoods
asset_denominations                   peer_events
assets                                peer_host_urls
attestations                          peer_hosts
authentifiers                         peers
balls                                 pending_shared_address_signing_paths
catchup_chain_balls                   pending_shared_addresses
correspondent_devices                 poll_choices
data_feeds                            polls
definitions                           shared_address_signing_paths
dependencies                          shared_addresses
device_messages                       skiplist_units
devices                               spend_proofs
earned_headers_commission_recipients  unhandled_joints
extended_pubkeys                      unhandled_private_payments
hash_tree_balls                       unit_authors
headers_commission_contributions      unit_witnesses
headers_commission_outputs            units
inputs                                votes
known_bad_joints                      wallet_signing_paths
messages                              wallets
my_addresses                          watched_light_addresses
my_witnesses                          witness_list_hashes
outbox                                witnessing_outputs

If you successfully connected to your byteball-hub database with sqlite3 and entered the .tables command you should see the available tables. If joints isn't there, then running the CREATE TABLE statement above will create it. After that it should run fine. Be aware, that when you have to mount the same docker volume to use the same database what you patched.

sjamayee commented 7 years ago

It works fine now. I have some problems with docker/volumes, have to check docker for this. But Byteball looks like a nice piece of software.

Thanks for your help.