yes, my server is having issues
whenever someone requests an invoice I have to find out what the current base-layer fees are so that I can set the minimum payment amount
when I launched zaplocker I almost immediately encountered a bug where the server hanged with no response from the third-party api I use to query for fees
I thought that third-party api was rate limiting me, which is an easy thing to fix, and I changed my code so that it caches responses from the api and reuses them rather than constantly querying the api. After that code change the server worked all day, but today it broke again
and now it seems that the api's rate limit isn't the limiting factor -- apparently my server's operating system gets upset when I make more than about a thousand total queries to that api without a dns cache refresh. Even though I'm now spacing out those queries over time, I'm not refreshing my dns lookup table cache, so the cache fills up and has no more room for more queries <-- note that some of the stuff in that paragraph involves things I do not understand, so some parts of my description of the problem are probably erroneous
so my own server is rate limiting me, causing me to have to restart it every so often because that's the only way I know how to refresh the dns lookup table
I'm really out of my depth with this whole "manage your own server" thing
thank you for your patience
No problem man, I know how it is.
10K requests indeed seems like a lot, but still I've never ran into an OS issue like that. What OS are you using?
reply
I talked with a smarter person I no longer think it's the OS. I think it's either our internet router or our internet service provider
the smarter person reminded me that dns lookups stop working on all of our work devices periodically and we usually fix it by restarting our router
the problem is usually discovered when someone tries to do npm install <package> on their laptop and npm just hangs, eventually telling us it can't resolve the dns name for registry.npmjs.com
the smarter person suspects it has something to do with the router trying to route over ipv6 but being busted somehow (or maybe our internet service provider is the one who's busted)
restarting the router fixes it and we've just been doing that so now I'm thinking it was maybe a poor decision to self host on a server that's connected to a router that frequently stops knowing how to map domain names to ip addresses
reply
You can try manually adding an entry to the /etc/hosts file. I know, this will break in the long term because it's akin to just using the IP directly, but it will at least allow us to test it for now :)
Also I managed to fetch the lnurl data and now I get a different error: invalid amount. The range is apparently 4187 to 9007199254740 sats. And I'm trying with 5K, 10K and 15K sats, all with the same results.
reply
You can try manually adding an entry to the /etc/hosts file
Good idea, I just did that
I managed to fetch the lnurl data and now I get a different error: invalid amount
What wallet are you using? Your lnurl works fine in lnbits and phoenix for me
reply
I tried to pay with breez
reply
hmm breez isn't available for my phone so I can't test it, I'm sorry that it isn't working for you!
reply
Ok I tried paying with lnbits as suggested and indeed it apparently worked. But when trying to claim with an invoice generated by LND I get:
status: nice try, asking me to pay you when the invoice that pays me is about to expire
This is funny, but wrong I think, because the payment only expires in ~800 minutes.
reply
Can you paste your invoice here? I wonder if its expiration time is longer than the expiry on the invoice that pays me. My server might be worried that you might wait for me to send you the money but not give me the preimage until my invoice expires, at which point I can no longer settle the one that pays me. It protects me from that by requiring that any invoice passed to me must have a shorter expiration time than what's leftover of the one that pays me. I can check if that's what happened if you paste the invoice here.
What about batching requests into a queue? Or does it need to be synchronous.
If IPv6 is causing problems, can you disable it? Though a past ISP for me only allowed IPv6, so I can understand that being limiting.
Maybe a the cheapest possible VPS with fixed IP could act as a proxy (or maybe would have the same problem).
At from my side sounds like a fun problem to solve :)
reply