Comments (4)
thank you very much.
from pgmoon.
I have same an issue when use hostname
Logs
Ping hostname
root@332bce82ae0a:~# ping dbhostname
PING dbhostname (172.23.0.3) 56(84) bytes of data.
64 bytes from myapp_postgres_1.myapp_default (172.23.0.3): icmp_seq=1 ttl=64 time=0.276 ms
64 bytes from myapp_postgres_1.myapp_default (172.23.0.3): icmp_seq=2 ttl=64 time=0.192 ms
64 bytes from myapp_postgres_1.myapp_default (172.23.0.3): icmp_seq=3 ttl=64 time=0.236 ms
^C
--- dbhostname ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2019ms
rtt min/avg/max/mdev = 0.192/0.234/0.276/0.038 ms
root@332bce82ae0a:~#
Pgmoon config
local pgmoon = require("pgmoon")
local pg = pgmoon.new({
host = "dbhostname",
port = "5432",
database = "pl_myapp_v1",
user = "postgres"
})
Error logs
no resolver defined to resolve "dbhostname"
stack traceback:
coroutine 0:
[C]: in function 'assert'
/usr/local/openresty/lualib/myapp/init.lua:22: in function 'app'
content_by_lua(default.conf:32):2: in function <content_by_lua(default.conf:32):1>, client: 172.23.0.1, server: localhost, request: "GET / HTTP/1.1", host: "web1.myapp.io"
2019/03/23 03:33:31 [error] 6#6: *16 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/myapp/init.lua:22: no resolver defined to resolve "dbhostname"
stack traceback:
coroutine 0:
[C]: in function 'assert'
/usr/local/openresty/lualib/myapp/init.lua:22: in function 'app'
content_by_lua(default.conf:32):2: in function <content_by_lua(default.conf:32):1>, client: 172.23.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "web1.myapp.io", referrer: "http://web1.myapp.io/"
from pgmoon.
@gzliudan
I find a temporary solution to fix this issue at
https://blog.wnotes.net/blog/article/lua-library-from-etc-hosts
In this article suggest use lua-local-resolve to resolve local hostname
from pgmoon.
This is an nginx/openresty specific issue: cosockets will use whaterver resolver you have provided in your nginx config. AFAIK pgmoon has no responsibility here.
from pgmoon.
Related Issues (20)
- support ipv6 by using luasocket HOT 1
- What should I do if error happens when using pg:query ? HOT 1
- Implement extended query protocol HOT 1
- attempt to call method 'keepalive' (a nil value) HOT 1
- [PostgreSQL 14.1] Why is the connection wrong and the encryption method is scram-sha-256? HOT 2
- It works in neovim!
- unable to read data from frontend HOT 4
- bad request on repeated requests HOT 3
- multi-hosts HOT 1
- pgmoon support automatic master-slave switch HOT 1
- Add locking to query functions HOT 1
- authentication exchange unsuccessful in postgresql 15 scram-sha-256 in scram_sha_256_auth
- lua entry thread aborted: runtime error: attempt to yield across C-call boundary HOT 2
- multiple statements in one query HOT 2
- Support all array types
- postgres:query() does not return error as 2. parameter
- Socket pool getreusedtimes function HOT 1
- Pool violation after v1.13 HOT 2
- Connection pooling outside of OpenResty?
- which pgmoon version can connect to postgresql 15 ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgmoon.