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

Runtime error: nil pointer dereference in StartNormalize activity on PostgresConnector #2354

Open
seonghobae opened this issue Dec 13, 2024 · 1 comment
Assignees

Comments

@seonghobae
Copy link

Description:
When running the StartNormalize activity in the PeerDB project (using the PostgresConnector), we encountered a runtime error due to a nil pointer dereference. This issue occurred repeatedly during normalization steps and appears to originate from normalize_stmt_generator.go and postgres.go within the Postgres connector logic.

Steps to Reproduce:

  1. Run a workflow that triggers the StartNormalize activity in a Temporal setup.
  2. Observe the workflow execution logs during the normalization phase.
  3. The error runtime error: invalid memory address or nil pointer dereference appears consistently, halting the normalization process.

Expected Behavior:
The StartNormalize activity should execute successfully, generating all necessary normalization statements and completing without runtime panics.

Actual Behavior:
The workflow fails at the StartNormalize activity with a panic caused by a nil pointer dereference. The provided stack trace shows that generateFallbackStatements in normalize_stmt_generator.go:80 attempts to access an uninitialized object.

Relevant Logs (Redacted for Security):

{"time":"2024-12-13T08:04:03Z","level":"ERROR","msg":"Activity panic.","ActivityType":"StartNormalize","PanicError":"runtime error: invalid memory address or nil pointer dereference","PanicStack":".../normalize_stmt_generator.go:80 +0x3d ..."}

Additional Context:

  • Ensuring that all structs and pointers are properly initialized before usage may prevent this error.
  • Adding defensive checks for nil before dereferencing objects in generateNormalizeStatements or generateFallbackStatements could be a potential fix.
  • It might be helpful to add logging or assertions around these code paths to identify uninitialized states earlier.
@serprex
Copy link
Contributor

serprex commented Dec 13, 2024

Looks like same thing as #2317 will need to replicate fix beyond snowflake

serprex added a commit that referenced this issue Dec 13, 2024
previously: #2317
came up with pg: #2354
serprex added a commit that referenced this issue Dec 14, 2024
previously: #2317
came up with pg: #2354
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

No branches or pull requests

3 participants