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

Harbourbridge error while installing #110

Closed
SchmJohan opened this issue Feb 1, 2021 · 6 comments
Closed

Harbourbridge error while installing #110

SchmJohan opened this issue Feb 1, 2021 · 6 comments

Comments

@SchmJohan
Copy link

Expected Behavior

Installation ready to use after command:

GO111MODULE=on go get github.com/cloudspannerecosystem/harbourbridge

Actual Behavior

Error when running installation command:

# github.com/lfittl/pg_query_go/parser
In file included from C:\Users\<user>\go\pkg\mod\github.com\lfittl\p[email protected]\parser\include/c.h:1129,
                 from C:\Users\<user>\go\pkg\mod\github.com\lfittl\p[email protected]\parser\include/postgres.h:47,
                 from contrib_pgcrypto_sha1.c:50:
C:\Users\<user>\go\pkg\mod\github.com\lfittl\p[email protected]\parser\include/port.h:17:10: fatal error: netdb.h: No such file or directory
   17 | #include <netdb.h>
      |          ^~~~~~~~~
compilation terminated.

Steps to Reproduce the Problem

  1. Install golang on windows
  2. Install mingw
  3. Install harbourbrige

Specifications

  • Version:
    • go: go1.15.7 windows/amd64
    • mingw: mingw 10.2.0
    • harbourbridge: latest
  • Platform:
    • windows 10
@SchmJohan SchmJohan changed the title Harbourbridge error while executing Harbourbridge error while installing Feb 1, 2021
@nevinheintze
Copy link
Collaborator

Hi Johannes,

Thanks for the detailed bug report. We're working to reproduce the error. This looks to be an issue with the github.com/lfittl/pg_query_go dependency we have -- that library is used to parse pg_dump output. We'll update again shortly. One quick question: where you planning to use HarbourBridge with MySQL or PostgreSQL?

Thanks,

Nevin.

@nevinheintze
Copy link
Collaborator

nevinheintze commented Feb 4, 2021

Quick update: it appears that mingw doesn't include netdb.h.
See for example msys2/MINGW-packages#3586, and https://www.gnu.org/software/gnulib/manual/html_node/netdb_002eh.html.
Also, there is an open issue for lfittl/pg_query_go on this: https://github.com/lfittl/pg_query_go/issues/25.
We'll update again shortly.

@nevinheintze
Copy link
Collaborator

One potential workaround is to use WSL2 (available on Windows 10: see https://docs.microsoft.com/en-us/windows/wsl/install-win10), and run HarbourBridge within the Linux subsystem.

@SchmJohan
Copy link
Author

Hi Nevin,
thanks for the quick response!

Thanks for the detailed bug report. We're working to reproduce the error. This looks to be an issue with the github.com/lfittl/pg_query_go dependency we have -- that library is used to parse pg_dump output.

Also, there is an open issue for lfittl/pg_query_go on this: lfittl/pg_query_go#25.

That is also the conclusion I have come to in the meantime!

One quick question: where you planning to use HarbourBridge with MySQL or PostgreSQL?

I am using Harbourbridge with Postgres / the output of pg_dump.

One potential workaround is to use WSL2

That is true, though I think my WSL is somewhat broken so I didn´t get that to work.
My workaround right now is to use Harbourbridge in the GCP Cloud Shell.
This works perfectly fine as I am currently just interested in the DDLs and the report, not in Data Migration.

I did stumble upon some more errors while executing Harbourbridge.
The following Error is raised whenever Harbourbridge encounters "))" at the end of an SQL Statement:

Generating schema: 60%
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xf8e55c]

I will submit another Issue for this Error.

Thanks for your support,

Johannes

@agasheesh agasheesh self-assigned this Feb 4, 2021
@nevinheintze
Copy link
Collaborator

Thanks Johannes!
Yes, please file another issue, and include a sample dump file that shows the issue if that is possible. I tried manually editing a pg_dump file and adding "))" in various combinations with some SQL statements, but only got parse errors (couldn't generate the SIGSEGV panic).

@agasheesh agasheesh removed their assignment Aug 22, 2022
@manitgupta
Copy link
Member

The only way for Windows is to run Harbourbridge using WSL2

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

4 participants