Git Product home page Git Product logo

Comments (4)

gzliudan avatar gzliudan commented on September 7, 2024 1

thank you very much.

from pgmoon.

puleeno avatar puleeno commented on September 7, 2024

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.

puleeno avatar puleeno commented on September 7, 2024

@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.

leafo avatar leafo commented on September 7, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.