Please login or register.

Problem with Wallet-RPC and woocommerce monero gateway plugi[...]

Hello monero community,

I am currently setting up an online shop. I want payment with monero to be possible. On my webserver I am using:

  • Wordpress Version 4.8.1
  • WooCommerce Version 3.1.2
  • Monero - WooCommerce Gateway by SerHack Version 1.0.0
  • Apache 2.4.27
  • PHP 5.6.31
  • MariaDB 10.0.32

I am in contact with SerHack via reddit. He said my plugin config looks okay. However I am getting the following error when trying to pay with the plugin:

Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to connect to myexternalserverip:18082/json_rpc Error: Failed to connect to myexternalserverip port 18082: Connection refused' in /home/megamone/public_html/wp-content/plugins/monero/library.php:154 Stack trace: #0 /home/megamone/public_html/wp-content/plugins/monero/library.php(98): Monero_Library->getResponse('{"jsonrpc":"2.0...') #1 /home/megamone/public_html/wp-content/plugins/monero/library.php(227): Monero_Library->request('make_integrated...', Array) #2 /home/megamone/public_html/wp-content/plugins/monero/library.php(288): Monero_Library->_run('make_integrated...', Array) #3 /home/megamone/public_html/wp-content/plugins/monero/include/monero_payments.php(246): Monero_Library->make_integrated_address('a5c535bb304733a...') #4 [internal function]: Monero_Gateway->instruction(70) #5 /home/megamone/public_html/wp-includes/class-wp-hook.php(298): call_user_func_array(Array, Array) #6 /home/megamone/public_html/wp-includes/class-wp-hook.php( in /home/megamone/public_html/wp-content/plugins/monero/library.php on line 154

I think the plugin works as intended and there is a problem with my RPC Server. I am running a monero node on my debian 8 VPS with the latest updates applied. The node is fully synced and reachable from inside and outside. I tested it with the wallet.

I am starting the rpc with the following command as normal user. The monero folder is in the home directory of the user.

./monero-wallet-rpc --wallet-file mywalletfile --password-file password.txt --rpc-bind-ip myexternalserverip --rpc-login myloginname:myloginpassword --rpc-bind-port 18082 --confirm-external-bind --log-level 4

With --log-level 4 I do not see any errors. Without a specific log level I can see the following error after some minutes:

(the IP shown here is neither my webserver IP or Node IP)

2017-09-12 16:41:17.618 [RPC0]  ERROR   net.http        contrib/epee/include/net/http_protocol_handler.inl:357  simple_http_connection_handler::handle_invoke_query_line(): Fai
led to match first line: CONNECT 45.33.54.195:80 HTTP/1.0


2017-09-12 16:41:17.618 [RPC0]  ERROR   net.http        contrib/epee/include/net/http_protocol_handler.inl:303  simple_http_connection_handler::handle_char_out: Error state!!!

The strange thing is that when I type into my browser: http://myexternalserverip:18082/json_rpc I get:

{
  "error": {
    "code": -32600,
    "message": "Invalid Request"
  },
  "id": 0,
  "jsonrpc": "2.0"
}

So RPC is working? I am very confused.

If you want I can supply a logfile.

Replies: 1
moneromooo edited 6 years ago Weight: 0 | Link [ - ]

"Connection refused" is usually when there is nothing listening (check you're really connecting to the server you think you are connecting to) or when a firewall is preventing the connection, or some intended forwarding is not active.

First thing to try is to connect via OS tools, to rule out monero: "telnet myexternalserverip 18082". If this does not work, fix it first.

More help can be had in #monero on Freenode IRC, as I don't check this forum often (pretty much nobody does, in fact).