go to /www/current and run
rails db
then run
insert into widgets set allowed_domains='testnet.bitshares.eu';
I should add this to the docs as well
I did that rails db command when Valzav helped merivercap fix the faucet for bts.bitcash.org. I hadn't done it in the /www/current directory though. I had just done it in the faucet dir. Running it in the correct directory fixed the widget issue, but I'm still having issues, in fact now my faucet isn't registering accounts at all. I probably messed something up when I was diggingh around in the mysql database. The browser console is now saying
Warning! faucet registration failed, falling back to direct application_api.create_account.. app.js:63:26532
ERROR AccountActions.createAccount Error: value required for registrar_id: null
Stack trace:
e.exports.required@https://dele-puppy.com/wallet/app.js:62:30878
v</<.value@https://dele-puppy.com/wallet/app.js:63:21890
z</<.value/c@https://dele-puppy.com/wallet/app.js:63:25616
z</<.value/<@https://dele-puppy.com/wallet/app.js:63:26640
I probably messed things up when I was trying to fix the other error.
edit. NM. It looks like the cli_wallet just wasn't connecting for some reason. After relaunching it I am back to square 1. Able to register with the faucet but not with a referrer. production log shows (this is a screen grab from nano, so the long lines are cut off)
I, [2016-03-24T17:31:32.066767 #22710] INFO -- : Started POST "/api/v1/accounts" for <ip redacted> at 2016-03-24 17:31:32 -0400
I, [2016-03-24T17:31:32.072970 #22710] INFO -- : Processing by Api::V1::AccountsController#create as JSON
I, [2016-03-24T17:31:32.073077 #22710] INFO -- : Parameters: {"account"=>{"name"=>"test-puppies-0", "owner_key"=>"BTS8Lzrh1BGHodkZTsgHys1KZoq1zduh5CYboggzqGtTLXcE2bAJk", "active_key"=>"BTS6LGzWJSffndeYKHNaG4keSUSUE48FPLZAeS8TE2VoigAus9b4z", "memo_key"=>"BTS6LGzWJSffn$
D, [2016-03-24T17:31:32.095777 #22710] DEBUG -- : ^[[1m^[[36m (0.2ms)^[[0m ^[[1mBEGIN^[[0m
D, [2016-03-24T17:31:32.105458 #22710] DEBUG -- : ^[[1m^[[35mBtsAccount Exists (0.5ms)^[[0m SELECT 1 AS one FROM `bts_accounts` WHERE `bts_accounts`.`remote_ip` = BINARY '<ip redacted>' AND (created_at > '2016-03-24 17:26:32') LIMIT 1
I, [2016-03-24T17:31:32.106557 #22710] INFO -- : ---- Registering account: 'test-puppies-0' BTS6LGzWJSffndeYKHNaG4keSUSUE48FPLZAeS8TE2VoigAus9b4z/BTS8Lzrh1BGHodkZTsgHys1KZoq1zduh5CYboggzqGtTLXcE2bAJk referrer:
I, [2016-03-24T17:31:32.107062 #22710] INFO -- : call: [0, "get_account", ["test-puppies-0"]]
E, [2016-03-24T17:31:32.149399 #22710] ERROR -- : Websocket RPC Error: {"code"=>1, "message"=>"10 assert_exception: Assert Exception\nrec && rec->name == account_name_or_id: \n {}\n th_a wallet.cpp:597 get_account", "data"=>{"code"=>10, "name"=>"assert_exception"$
I, [2016-03-24T17:31:32.150292 #22710] INFO -- : call: [0, "register_account", ["test-puppies-0", "BTS6LGzWJSffndeYKHNaG4keSUSUE48FPLZAeS8TE2VoigAus9b4z", "BTS8Lzrh1BGHodkZTsgHys1KZoq1zduh5CYboggzqGtTLXcE2bAJk", "dele-puppy-reg", "dele-puppy-reg", 0, true]]
D, [2016-03-24T17:31:32.253547 #22710] DEBUG -- : {"ref_block_num"=>10930, "ref_block_prefix"=>1598310984, "expiration"=>"2016-03-24T21:32:00", "operations"=>[[5, {"fee"=>{"amount"=>1483385, "asset_id"=>"1.3.0"}, "registrar"=>"1.2.101323", "referrer"=>"1.2.101323", "ref$
D, [2016-03-24T17:31:32.256441 #22710] DEBUG -- : ^[[1m^[[36mSQL (0.7ms)^[[0m ^[[1mINSERT INTO `bts_accounts` (`name`, `owner_key`, `active_key`, `memo_key`, `remote_ip`, `created_at`, `updated_at`) VALUES ('test-puppies-0', 'BTS8Lzrh1BGHodkZTsgHys1KZoq1zduh5CYboggzq$
D, [2016-03-24T17:31:32.258998 #22710] DEBUG -- : ^[[1m^[[35m (1.4ms)^[[0m COMMIT
I, [2016-03-24T17:31:32.274106 #22710] INFO -- : Rendered api/v1/accounts/show.json.jbuilder (10.8ms)
I, [2016-03-24T17:31:32.274646 #22710] INFO -- : Completed 201 Created in 201ms (Views: 15.1ms | ActiveRecord: 3.9ms)
I, [2016-03-24T17:33:37.223953 #22710] INFO -- : Started GET "/" for 66.249.79.247 at 2016-03-24 17:33:37 -0400
I, [2016-03-24T17:33:37.225372 #22710] INFO -- : Processing by WalletController#index as HTML
I, [2016-03-24T17:33:37.226837 #22710] INFO -- : Rendered wallet/index.html.erb (0.1ms)
I, [2016-03-24T17:33:37.227106 #22710] INFO -- : Completed 200 OK in 2ms (Views: 0.7ms | ActiveRecord: 0.0ms)
I, [2016-03-24T17:33:56.439781 #22710] INFO -- : Started GET "/?r=dele-puppy" for <ip redacted> at 2016-03-24 17:33:56 -0400
I, [2016-03-24T17:33:56.441443 #22710] INFO -- : Processing by WalletController#index as HTML
I, [2016-03-24T17:33:56.441506 #22710] INFO -- : Parameters: {"r"=>"dele-puppy"}
I, [2016-03-24T17:33:56.443207 #22710] INFO -- : Rendered wallet/index.html.erb (0.1ms)
I, [2016-03-24T17:33:56.443668 #22710] INFO -- : Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.0ms)
I, [2016-03-24T17:33:57.167088 #22710] INFO -- : Started GET "/widgets/1/w.js?ref=" for <ip redacted> at 2016-03-24 17:33:57 -0400
I, [2016-03-24T17:33:57.168434 #22710] INFO -- : Processing by WidgetsController#w as JS
I, [2016-03-24T17:33:57.168508 #22710] INFO -- : Parameters: {"ref"=>"", "widget_id"=>"1"}
D, [2016-03-24T17:33:57.169852 #22710] DEBUG -- : ^[[1m^[[36mWidget Load (0.2ms)^[[0m ^[[1mSELECT `widgets`.* FROM `widgets` WHERE `widgets`.`id` = 1 LIMIT 1^[[0m
I, [2016-03-24T17:33:57.170397 #22710] INFO -- : Completed 404 Not Found in 2ms (ActiveRecord: 0.2ms)
F, [2016-03-24T17:33:57.171202 #22710] FATAL -- :
ActiveRecord::RecordNotFound (Couldn't find Widget with 'id'=1):
app/controllers/widgets_controller.rb:9:in `w'
rails db from the /www/current directory returns
mysql> select allowed_domains from widgets;
+-----------------+
| allowed_domains |
+-----------------+
| localhost |
| dele-puppy.com |
+-----------------+
2 rows in set (0.00 sec)
I think it might have something to do with the wrong database loading. status shows
mysql> status
--------------
/usr/bin/mysql Ver 14.14 Distrib 5.5.47, for debian-linux-gnu (x86_64) using readline 6.3
Connection id: 416
Current database: bitshares_faucet_dev
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.47-0ubuntu0.14.04.1 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 35 days 22 hours 55 min 58 sec
Threads: 3 Questions: 11019 Slow queries: 2 Opens: 348 Flush tables: 1 Open tables: 57 Queries per second avg: 0.003
--------------
Perhaps this is related to an issue in my environment that is causing the bitshares_faucet_dev db to load rather than the bitshares_faucet db. I am just spitballing here though, as I stated earlier if I was a super hero my name would be supernoob, cause I really have no idea what I am doing. Any assistance is appreciated. If nothing else I am building a new faucet on a new server. I'll see if I have the same issues on that server.