Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't override with local postgresql on node #2389

Closed
aviramha opened this issue Apr 22, 2024 · 0 comments · Fixed by #2390
Closed

Can't override with local postgresql on node #2389

aviramha opened this issue Apr 22, 2024 · 0 comments · Fixed by #2390

Comments

@aviramha
Copy link
Member

aviramha commented Apr 22, 2024

on macOS (arm64)
v20.10.0
package.json:

{
  "name": "reproduce_postrgesql",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "pg": "^8.11.5",
    "pg-native": "^3.0.1",
    "pg-pool": "^3.6.2"
  }
}

main.mjs:

import pg from 'pg'
const { native } = pg
const { Client, Pool } = native


var pool = new Pool({connectionString: "postgres://user:pass@localhost/dbname"})
await pool.connect()
const res = await client.query('SELECT $1::text as message', ['Hello world!'])
console.log(res.rows[0].message) // Hello world!

mirrord.json:

{
  "feature": {
    "network": {
      "outgoing": {
        "filter": {
          "local": [":5432"]
        }
      }
    }
  }
}

mirrord command line:
mirrord exec -f /Users/aviramhassan/Code/mirrord/.mirrord/mirrord.json -t deployment/ip-visit-counter -- node main.mjs

We get the next error:

2024-04-22T19:08:16.249957Z TRACE ThreadId(04) connect:connect_outgoing:get_connection_through: mirrord_layer::socket: return=Err(IO(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })) sockfd=22 address_length=16 sockfd=22 remote_address=SockAddr { ss_len: 16, ss_family: 2, len: 16 } user_socket_info=UserSocket { domain: 2, type_: 1, protocol: 0, state: Initialized, kind: Tcp(1) } protocol=Stream self=Local({OutgoingFilter { protocol: Any, address: Socket(0.0.0.0:5432) }}) address=127.0.0.1:5432 protocol=Stream
2024-04-22T19:08:16.250016Z TRACE ThreadId(04) connect:connect_outgoing:get_connection_through: mirrord_layer::socket: close time.busy=1.76ms time.idle=154µs sockfd=22 address_length=16 sockfd=22 remote_address=SockAddr { ss_len: 16, ss_family: 2, len: 16 } user_socket_info=UserSocket { domain: 2, type_: 1, protocol: 0, state: Initialized, kind: Tcp(1) } protocol=Stream self=Local({OutgoingFilter { protocol: Any, address: Socket(0.0.0.0:5432) }}) address=127.0.0.1:5432 protocol=Stream
2024-04-22T19:08:16.250341Z TRACE ThreadId(04) connect:connect_outgoing: mirrord_layer::socket::ops: return=Error(IO(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })) sockfd=22 address_length=16 sockfd=22 remote_address=SockAddr { ss_len: 16, ss_family: 2, len: 16 } user_socket_info=UserSocket { domain: 2, type_: 1, protocol: 0, state: Initialized, kind: Tcp(1) } protocol=Stream
2024-04-22T19:08:16.250402Z TRACE ThreadId(04) connect:connect_outgoing: mirrord_layer::socket::ops: close time.busy=2.34ms time.idle=44.5µs sockfd=22 address_length=16 sockfd=22 remote_address=SockAddr { ss_len: 16, ss_family: 2, len: 16 } user_socket_info=UserSocket { domain: 2, type_: 1, protocol: 0, state: Initialized, kind: Tcp(1) } protocol=Stream
2024-04-22T19:08:16.250454Z TRACE ThreadId(04) connect: mirrord_layer::socket::ops: return=Error(IO(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })) sockfd=22 address_length=16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant