Open seak1234 opened 1 year ago
I believe createInvoice
is called from inside of ligess\node_modules\una-wrapper\dist\index.cjs. Error occurs at line 135 when calling base64ToHex(response.r_hash)
, where response.r_hash = undefined
);
const body = this.prepareBody(data);
const options = this.getRequestOptions(EHttpVerb.POST, "/v1/invoices");
const response = await this.request(options, body);
return await this.getInvoice(base64ToHex(response.r_hash));
Values of variables
body value:
{"value_msat":"1000","description_hash":"uWrBTOziVlvmnxUY5aB2odQU6VDeVcQ8JSmMIHkKrBA="}
option value:
{"method":"POST","path":"/v1/invoices",
"agent":{"_events":{},"_eventsCount":0,"timeout":null,
"maxFreeSockets":1,"maxSockets":1,"maxTotalSockets":null,
"sockets":{},"freeSockets":{},"requests":{},"options":{},
"shouldLookup":false,"proxy":{"host":"127.0.0.1","port":9050,"type":5},
"tlsConnectionOptions":{"rejectUnauthorized":false}},
"headers":{"Grpc-Metadata-macaroon":
"0201036c6e640258030a10...............#shortened#...................33c987a"},
"protocol":"https:","hostname":"lnd.satoshibox.org","port":"","pathname":"/"}
response value:
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Just a moment...</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="/cdn-cgi/styles/challenges.css" rel="stylesheet">
</head>
<body class="no-js">
<div class="main-wrapper" role="main">
<div class="main-content">
<noscript>
<div id="challenge-error-title">
<div class="h2">
<span class="icon-wrapper">
<div class="heading-icon warning-icon"></div>
</span>
<span id="challenge-error-text">
Enable JavaScript and cookies to continue
</span>
</div>
</div>
</noscript>
<div id="trk_jschal_js" style="display:none;background-image:url('/cdn-cgi/images/trace/managed/nojs/transparent.gif?ray=7cca3313bbc0b72a')"></div>
<form id="challenge-form" action="/v1/invoices?__cf_chl_f_tk=................#shortened#........-1684980181-0-gaNycGzNCzs" method="POST" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="md" value="P.VxGUCm6g0Vaz560BPi8_WoCHtwoH7ryY..................................#shortened#...............t7q3rAHXLbmJof073IssQ_CDKfQiuzUr9b4MJXUNcFKTQ">
</form>
</div>
</div>
<script>
(function(){
window._cf_chl_opt={
cvId: '2',
cZone: 'lnd.satoshibox.org',
cType: 'managed',
cNounce: '22253',
cRay: '7cca3313bbc0b72a',
cHash: '015a14e25fb260a',
cUPMDTk: "\/v1\/invoices?__cf_chl_tk=D5dVe3DKpXNXA065T2acJt068D1viDZdMGZc52Z2mHA-1684980181-0-gaNycGzNCzs",
cFPWv: 'b',
cTTimeMs: '1000',
cMTimeMs: '0',
cTplV: 5,
cTplB: 'cf',
cK: "",
cRq: {
ru: 'aHR0cHM6Ly9sbmQuc2F0b3NoaWJveC5vcmcvdjEvaW52b2ljZXM=',
ra: 'Tk9fVUE=',
rm: 'UE9TVA==',
d: 'PARCN8x9oKwceJ0CDyUDbO................#shortened#........IESzu6kJS0zKbQt',
t: 'MTY4NDk4MDE4MS4wNzIwMDA=',
m: 'Cq2MVxkRrw1QIgLjfuMxT8CHAbAJ4YII/zDOFUXODp8=',
i1: 'bUDVr5h20w4uguFL43obJg==',
i2: 'm4m3zBiwORZkTxCdcIUA9A==',
zh: 'QqOYPcTxAjVIi5IUERncwNkdUsKJiHsMXNqipqg3jb8=',
uh: 'DV4j3Tmrbi5Rs1q3ahwVS6SgbPbI7np5884QO1u1Cgg=',
hh: 'Hizy1AJuAvrKivs3L0g7lArjQ/B/Yt6zYxrCMOAOR2o=',
}
};
var trkjs = document.createElement('img');
trkjs.setAttribute('src', '/cdn-cgi/images/trace/managed/js/transparent.gif?ray=7cca3313bbc0b72a');
trkjs.setAttribute('alt', '');
trkjs.setAttribute('style', 'display: none');
document.body.appendChild(trkjs);
var cpo = document.createElement('script');
cpo.src = '/cdn-cgi/challenge-platform/h/b/orchestrate/managed/v1?ray=7cca3313bbc0b72a';
window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;
window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, location.href.length - window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;
if (window.history && window.history.replaceState) {
var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;
history.replaceState(null, null, "\/v1\/invoices?__cf_chl_rt_tk=D5dVe3DKpXNXA065T2acJt068D1viDZdMGZc52Z2mHA-1684980181-0-gaNycGzNCzs" + window._cf_chl_opt.cOgUHash);
cpo.onload = function() {
history.replaceState(null, null, ogU);
};
}
document.getElementsByTagName('head')[0].appendChild(cpo);
}());
</script>
</body>
</html>
response.r_hash value:
undefined
This is where I am stuck currently. response
looks incorrect to me
Issue could be recreated running yarn dev & docker-compose up
Hey,
after updating my lnd node to lnd v0.16.2-beta I noticed that ligess on my node cannot create invoices anymore. It used to work a few weeks ago. Not sure if updating lnd is even related to this issue though.
Terminal out put:
Initial debugging: There seems to be two parts to this:
Focussing on point 2 There seems to be an issue with the una-wrapper (Universal Node API) when creating an invoice in router.js, executing the createInvoice function call:
Function call uses the following inputs according to
console.log()
:This will lead to:
Unfortunately, I am not a java script guy. Debugging this issue by myself will take forever. Does anyone have an idea what is going on and point me to something?
Any help is much appreciated!