How to get more information for an error generated in libcontainer/rootfs_linux.go? - docker

Code used from github: https://github.com/opencontainers/runc/blob/master/libcontainer/rootfs_linux.go#L59
This is the if block to debug for our interest....
if err := mountToRootfs(m, config.Rootfs, config.MountLabel, hasCgroupns); err != nil {
return newSystemErrorWithCausef(err, "mounting %q to rootfs at %q", m.Source, m.Destination)
}
Here in the if condition, there is an error generated thru newSystemErrorWithCausef function and which internally uses generic_error.go, fmt.Sprintf to format the error string.
In our integration, only once it hit this if block. And in the process of getting more details, I wanted to troubleshoot and understand why this happened.
As of now tried using fmt.Printf(........) in line 55 and also just before if block of line 59.
And also tried putting above statement in very first line of prepareRootfs function. And then tried newSystemErrorWithCause(err, "some other message") in the first line of prepareRootfs function. Overall I dont see any information generated with my messages.
Please provide any information to understand more of this issue. Please note I am not looking for why this error might have been caused. I am looking for how to get more information from that function of prepareRootfs.

Related

How do I find the error details using the match function on Lua?

I'm just asking a question on finding error details from the error function.
Like I would like to find error details from example.lua:50: "then" expected near "if".
Any ways on how to do that on Lua? I'm working on something for ComputerCraft on Lua. (Minecraft Java mod)
EDIT:
I'm trying make a function that returns the error parsed out. It's supposed to return 3 variables, var1: file name, var2: line number (if none it is specified nil), var3: error text.
example.lua is the file where the error is. 50 is the line number. There is a syntax error, likely in the if condition. (I'm not familiar with ComputerCraft, so I don't know where that file might be.)

What does this ejabberd / erlang stack trace mean?

could someone help me figure out what to look for in this stacktrace? I've never touched Erlang, so I don't really know where to start.
We're using v19.09 of ejabberd, and getting this error log for many users:
2020-03-14 15:29:31.096 [error] <0.2029.48>#mod_http_api:handle:257 REST API Error: set_presence([{<<"user">>,<<"53265363">>},{<<"host">>,<<"chat.us.com">>},{<<"resource">>,<<"ssid-3465">>},{<<"type">>,<<"available">>},{<<"show">>,<<"chat">>},{<<"status">>,<<"{\"current_lobby_id\":\"none\",\"status\":\"{\\r\
\\t\\\"rich_presence\\\": \\\"{\\\\r\\\
\\\\t\\\\\\\"rich_presence\\\\\\\": \\\\\\\"?s=PlayerStatusInMap?p0=21?p1=2?p2=3\\\\\\\",\\\\r\\\
\\\\t\\\\\\\"session_id\\\\\\\": \\\\\\\"ssid-3465-38a44f60-9df7-4c79-8c8e-1cc99e5039dd\\\\\\\"\\\\r\\\
}\\\",\\r\
\\t\\\"current_lobby_id\\\": \\\"{\\\\r\\\
\\\\t\\\\\\\"lobby_id\\\\\\\": \\\\\\\"c791cfaa-9fd3-4d0d-9d5c-1aeb9efb12e2#hangouts.chat.us.com\\\\\\\",\\\\r\\\
\\\\t\\\\\\\"privacy\\\\\\\": \\\\\\\"friends_only\\\\\\\"\\\\r\\\
}\\\"\\r\
}\",\"region\":\"\"}">>},{<<"priority">>,<<"0">>}]) -> exit:{noproc,{p1_server,call,[none,{set_presence,{presence,<<>>,available,<<>>,{jid,<<"953265363">>,<<"chat.us.com">>,<<"oak/ssid-3465-1cc99e5039dd">>,<<"1953265363">>,<<"chat.us.com">>,<<"4c79-8c8e-1cc99e5039dd">>},{jid,<<"1953265363">>,<<"chat.us.com">>,<<>>,<<"1953265363">>,<<"chat.us.com">>,<<>>},chat,[{text,<<"en">>,<<"{\"current_lobby_id\":\"none\",\"status\":\"{\\r\
\\t\\\"rich_presence\\\": \\\"{\\\\r\\\
\\\\t\\\\\\\"rich_presence\\\\\\\": \\\\\\\"?s=PlayerStatusInMap?p0=21?p1=2?p2=3\\\\\\\",\\\\r\\\
\\\\t\\\\\\\"session_id\\\\\\\": \\\\\\\"ssid-348c8e-1cc99e5039dd\\\\\\\"\\\\r\\\
}\\\",\\r\
\\t\\\"current_lobby_id\\\": \\\"{\\\\r\\\
\\\\t\\\\\\\"lobby_id\\\\\\\": \\\\\\\"c791cfaa-9fd3-4d0d-9d5c-1aeb9efb12e2#hangouts.chat.us.com\\\\\\\",\\\\r\\\
\\\\t\\\\\\\"privacy\\\\\\\": \\\\\\\"friends_only\\\\\\\"\\\\r\\\
}\\\"\\r\
}\",\"region\":\"\"}">>}],0,[],#{}}},1000]}} [{p1_server,call,3,[{file,"src/p1_server.erl"},{line,210}]},{mod_http_api,handle2,4,[{file,"src/mod_http_api.erl"},{line,267}]},{mod_http_api,handle,4,[{file,"src/mod_http_api.erl"},{line,228}]},{mod_http_api,perform_call,4,[{file,"src/mod_http_api.erl"},{line,188}]},{mod_http_api,process,2,[{file,"src/mod_http_api.erl"},{line,141}]},{ejabberd_http,process,2,[{file,"src/ejabberd_http.erl"},{line,366}]},{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,488}]},{ejabberd_http,process_header,2,[{file,"src/ejabberd_http.erl"},{line,286}]}]
Start with the actual error, which is buried in the middle:
exit:{noproc,{p1_server,call,[none,{set_presence,.....
So there is a noproc error, which occurred during a call to p1_server:call, where the first argument is none. (The call would look like p1_server:call(none, {set_presence,...}).) That is, we're asking the process called none to execute the command set_presence, which fails because there is no process registered with the name none.
Now let's look at the stack trace. I added line breaks:
[{p1_server,call,3,[{file,"src/p1_server.erl"},{line,210}]},
{mod_http_api,handle2,4,[{file,"src/mod_http_api.erl"},{line,267}]},
{mod_http_api,handle,4,[{file,"src/mod_http_api.erl"},{line,228}]},
{mod_http_api,perform_call,4,[{file,"src/mod_http_api.erl"},{line,188}]},
{mod_http_api,process,2,[{file,"src/mod_http_api.erl"},{line,141}]},
{ejabberd_http,process,2,[{file,"src/ejabberd_http.erl"},{line,366}]},
{ejabberd_http,process_request,1,[{file,"src/ejabberd_http.erl"},{line,488}]},
{ejabberd_http,process_header,2,[{file,"src/ejabberd_http.erl"},{line,286}]}]
The first line is where it discovers that there is no such process, on line 210 in p1_server.erl. But we're more interested in why we're passing none as the argument in the first place. The stack trace suggests that's happening somewhere in mod_http_api.erl, but at that point I'm getting lost - it seems like it's extracting the arguments from the command, but I don't understand where the none is coming from...

Error running call reference function

I am having an error whilst trying to run a resource on a game server. I believe this line of code in the console is the issue;
Error running call reference function for resource es_extended:
citizen:/scripting/lua/scheduler.lua:351: server/main.lua:237: attempt to
index a nil value (global 'Async')
I have been to line 351 to find this;
error(err)
I then went to line 237 to find this;
Async.parallel(tasks, function(results)
I cannot see for the life of me anything wrong with either lines of code. So any and all advice is greatly recieved.
The global variable Async is a nil value. Hence indexing it like this:
Async.parallel
is not possible. Therefor Lua throws an error.
To fix it, find out why Async is nil and change that, or do not index it.

bad argument in call to crypto:aes_cfb_128_crypt

This is the code snippet at line 461 which is giving badarg error ,please help me solve this error guys.
ejabberd_odbc:escape(base64:encode(crypto:aes_cfb_128_encrypt(<<"abcdefghabcdefgh">>, <<"12345678abcdefgh">>, xml:element_to_binary(NewPacket)))),
Log:
bad argument in call to crypto:aes_cfb_128_crypt(<<"abcdefghabcdefgh">>, <<"12345678abcdefgh">>, <<">, true) in mod_offline:'-store_offline_msg/6-fun-2-'/2 line 225
One of the things I like about functional languages is that you generally have an easier time reproducing errors in a controlled environment. In your case, it seems like
base64:decode(XML)
is the call that's failing, so you should write
io:format("XML=~p~n", [XML]),
base64:decode(XML)
the first line will print out the contents of XML in Erlang syntax, and the second line will fail when you get to the bad input.
Once you see the string you're trying to decode, the problem will probably be obvious (it's not a string or it's not a base64 string). If it is a correctly-encoded base64 string, then you can post that problem as a StackOverflow question and get a more useful response.

is it possible to catch 404 error without exit run in python?

I want to download a bunch of url list by:
urllib.request.urlretrieve(url, filename)
but sadly, few links are broken. and when urlretrieve meets that broken link
Traceback (most recent call last):
File "D:/Users/hyungsoo/PycharmProjects/untitled/check.py", line 71, in <module>
....blah_blah....
urllib.error.HTTPError: HTTP Error 404: Not Found
give me this error sign and program exited.
how to pass the broken url?
and moreover, is it possible to program tells me what link is broken?
You could try a "try...except..." statement, which you may find helpful. The "try" portion will attempt the given code, but the
"except" portion will be ready for the error message. It is really a wonderful feature. See teh following example:
while True:
... try:
... x = int(raw_input("Please enter a number: "))
... break
... except ValueError:
... print "Oops! That was no valid number. Try again..."
Note: Code taken from python APIs.

Resources