HTTP Communication failure - 500 Native SSL error - json

We are using Google API to compute mileage for our travel. Everything was working fine for over 1 year, however we started having the below said issue in the last couple of months.
Our program is able to connect to the API, the API returning with the error message http_communication_failure. The exact error is Application Server
Error 500 Native SSL error
Error is logged with Tag: {0001fee7}Thu Jun
21 09:36:49 2018
When I pasted the URL in the browser, it is returning the mileage information. However through the API call (receive data) in the program, we are getting this error message.
No program changes or Certificate changes have been done in the last 1 year. Our Basis team looked in to the possible issues with SSL. Everything seems to be OK from our end. I looked through your troubleshooting page, and tried all the suggested solutions. Nothing seem to fix our problem. Please let us know what else we need to look at.
CONCATENATE 'https://maps.googleapis.com/maps/api/distancematrix/xml?origins=' lv_dep '&destinations=' lv_arr '&units=imperial'
'&key=' lv_key
INTO lv_http_url.
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = lv_http_url
ssl_id = 'ANONYM'
IMPORTING
client = lo_http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
others = 4.
IF sy-subrc EQ 0.
lo_http_client->send( EXCEPTIONS http_communication_failure = 1
http_invalid_state = 2 ).
CALL METHOD lo_http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
others = 4.

See if port 443 is create in Trns: smicm, if you can't see it, create it.
increase the trace in menu go to->trace level.
call Appi and see log.
if you see a error about SSL, export the certificate from your PC, I supose is "google trust service".
go trns: STRUST in SAP and inport the new certificate.

Related

How to properly parse a JSON table for use in a Value function?

I have failed miserably several times to use httpservice to successfully draw information off of my server for use in my Roblox game I am working on. After a number of failed efforts, I discovered that the main problem was I am failing to parse the table to get the value I need from the JSON table and that is, I think, why I can't get the Currency Handler script to accept the value.
I have an Ubuntu server service and something called Putty to access it.
I have done enough trial and error to believe that the handler script is working as intended except for not receiving the information from the next script correctly.
game.Players.PlayerAdded:Connect(function(player)
local value = Instance.new("NumberValue", player)
value.Name = "Currency"
value.Value = 0
local HttpService = game:GetService("HttpService")
local userID = '0' --player.UserId
local wallet = "http://x8/"
local mining = wallet..userID
local response = HttpService:GetAsync(mining, HttpService:JSONDecode(), Enum.HttpContentType.ApplicationJson)
local a,b,c,d = table.remove(response)
local function f()
value.Value = 1
end
end)
I also have a localscript running that looks like this.
local player = game.Players.LocalPlayer
player:WaitForChild("Currency").changed:Connect(function(value)
script.Parent.Currency.Text = "D "..value
end)
script.Parent.Currency.Text = "D "..player:WaitForChild("Currency").Value
This is after reading the various manuals from Piglet.
I am not a professional programmer or software engineer. I don't really know much about programming except what I have been able to glean from youtube and a few online tutorials. I've come as far as I can with those resources. The irony is I think this should be my last major hurdle to accomplishing my goals of getting a working Roblox game. I've used Wiki, and Roblox developer forums, but I don't fully understand them.
I was able to generate a table using the code above, but the table.remove is still not working. I will attempt to correct that problem, and this is the code I came up with
local mining = wallet..userID
local response
local data
response = HttpService:GetAsync(mining)
data = HttpService:JSONDecode(response, Enum.HttpContentType.ApplicationJson)
local a = Instance.new("NumberValue", player)
a = (data["result"]["amount"])
print(data["result"]["amount"])
print(a)
value.Value = a
print(value.Value)
return value
end)
not sure if this was the right way to do things, but it worked.

CreateFile failed with 5

I'm using win xp Professional x64 Edition and I'm trying to send message to Windows Message Service like using net send. I'm using mailslot:
LPCTSTR SlotName = TEXT("\\\\.\\mailslot\\messngr");
hFile = CreateFile(SlotName,
GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_WRITE | FILE_SHARE_READ,
(LPSECURITY_ATTRIBUTES)NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
(HANDLE)NULL);
and after launching it, I got error 5 from GetLastError() in CreateFile. I don't know how to fix it. I gave all VM permission, I turned message service ofc, and I can open it to be notpad like others suggested in: CreateFile() Failed With GetLastError() = 5. I tried many flags, but it didn't change anything. Any guess?
Like it says in the mailslot documentation, only the process that created the mailslot can read from it. Mailslots are one-way communication.
Remove the request for read access.

com.hierynomus.mssmb2.SMBApiException: STATUS_NETWORK_NAME_DELETED exception

I am getting the following error stack trace, when I am trying to connect an SMB share that I connect using the library most of the time, so yes the code mostly works but sometimes not. I could not try anything yet because I do not have any idea about what can be wrong, the share config, the network or the code, no idea.
com.hierynomus.mssmb2.SMBApiException: STATUS_NETWORK_NAME_DELETED (0xc00000c9): Authentication failed for 'your-user' using com.hierynomus.smbj.auth.NtlmAuthenticator#565d98da
com.hierynomus.smbj.connection.Connection.authenticate(Connection.java:182)
Here is my SmbConfig and I am using the 0.9.1 of smbj.
SmbConfig config = SmbConfig.builder()
.withMultiProtocolNegotiate(true)
.withSigningRequired(true)
.withDfsEnabled(true)
.build();
Here https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-smb/6ab6ca20-b404-41fd-b91a-2ed39e3762ea it gives more information about 0xC00000C9 - STATUS_NETWORK_NAME_DELETED exception and says
The network name specified by the client has been deleted on the
server. This error is returned if the client specifies an incorrect
TID or the share on the server represented by the TID was deleted.
Should I think something happened to the share on the windows server during the execution of the code?

EMQTT - emq_plugin_template POST to API (SQL) issue with gateway client only

I have followed a tutorial from Ravi Pujar on passing MQTT messages to SQL using EMQ and an api interface (he has also got some help from here to make the relevant plugin work).
I am entirely new to Erlang + EMQ, any help on resolving why only my gateway’s messages aren’t saved when posted from EMQ plugin is appreciated :
When I post with postman through HTTP API the log is saved fine into
SQL fine.
When I connect to the broker and publish using MQTTfx to the topic it
gets saved fine into SQL as well (which is through the plugin).
When my gateway publishes to the topic the published messages aren’t
logged into the SQL (through the plugin again) but publish fine on the topic.
SQL table has just one string field which allows null.
Example gateway message (Saves fine if posted from postman to api or published on topic from MQTTfx):
$GPRP,745HHBCC5FF,EC16CRH9FFC,-54,0201135644GG46E0082D8A80EFD6EAD1E9A1B132BE1,153656726
I am using “emq_plugin_template.erl” and “on_message_publish” to send my request. Plugin compiles with no errors,EMQ restarted, plugin enabled on the board and it runs smoothly. I am also subscribed to the correct topic of course on the gateway.
on_message_publish(Message, _Env) ->
io:format("publish ~s~n", [emqttd_message:format(Message)]),
MessageBin = element(12, Message),
MessageStr = binary_to_list(MessageBin),
inets:start(),
Method = post,
URL = "http://127.0.0.1/api/v2/GatewaySQL/1234",
Header = [{"X-DreamFactory-Api-Key", "1234"}],
Type = "application/json",
%%Body = MessageStr, %%just that didn't work with gateway
Body = "{\"resource\":[{\"TagRAW\":\"" ++ MessageStr ++ "\"}]}",
HTTPOptions = [],
Options = [],
R = httpc:request(Method, {URL, Header, Type, Body},HTTPOptions,Options),
{ok, Message}.
Checking QOS:
I have confirmed QOS (QOS 0 messages) topic subscribe is correct should i check somewhere else for a mismatch? Same QOS from MQTTfx saved fine into SQL though and published on the topic.
Removing commas in received message:
I have just in case tried removing commas from the message (and the $ in one of the attempts below, had more attempts some compiled fine but then the broker might have got stuck):
%%lists:delete($$,MessageStr),
%%lists:flatten(MessageStr), %%tried without flattening it as well
%%Segmented = string:tokens(MessageStr, ","),
%%lists:flatten(Segmented),
%%IOMessageStr = io_lib:format("~w",[MessageStr]),
%%Flattened = lists:flatten(IOMessageStr),
Thank you for your time :)
Try to replace
MessageBin = element(12, Message),
with
MessageBin = element(8, Message),
Hope, this will work for you.

Got blocked by Google Finance

I was trying to write come code for stock market predictions and everything was working fine until it suddenly stopped working and threw an error:
----> 1 get_price_data({'q': 'GOOG', 'i': 86400, 'x': 'NASDAQ', 'p': '1Y'})
/usr/local/lib/python3.6/dist-packages/googlefinance/client.py in get_price_data(query)
12 for price in lines:
13 cols = price.split(",")
---> 14 if cols[0][0] == 'a':
15 basetime = int(cols[0][1:])
16 index.append(datetime.fromtimestamp(basetime))
IndexError: string index out of range
I went to http://finance.google.com/finance/info?client=ig&q=NASDAQ:GOOG
and it said there " We're sorry... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now." ............
So i googled it and on the help page it said "
If you see a message that says "We're sorry, but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.":
Open this reCAPTCHA page.
If you see a normal CAPTCHA (letters or numbers) your computer and network are safe. The site you came from could have a configuration problem. Try to let them know about it.
If you still see the "We're sorry, but your computer..." message, then there may be something wrong. See the tips at our unusual traffic help page.
"
but clicking on "this reCAPTCHA" sends me to as error page "Not Found Error 404"
What do I do?
I tried asking on the Google forum, and immediately got a bunch of hacker responses asking to install remote desktop control :\ ...