apache / hop

Hop Orchestration Platform
https://hop.apache.org/
Apache License 2.0
985 stars 354 forks source link

[Bug]: Database Lookup not initializing with Enviroment Parameter using Workflow #3452

Open Cupropituvanso opened 1 year ago

Cupropituvanso commented 1 year ago

Apache Hop version?

2.6

Java version?

openjdk version "11.0.20" 2023-07-18

Operating system

Docker

What happened?

Code Snippets and Logs shows more than thousands words:

Relational Database Connection: jdbc:oracle:thin:@//${FBAT_EF3_REPORTING_DB_HOST}:1521/${FBAT_EF3_REPORTING_DB_NAME}

Envirement Development Config Files: local-development.json

Content of Config File: FBAT_EF3_REPORTING_DB_HOST correct hostname FBAT_EF3_REPORTING_DB_NAME correct db name [...]

Starting of a pipeline via gui directly, no problem. Starting of a workflow (via gui or webservice) which triggers the same pipeline:

2023/11/22 15:53:37 - Database lookup NUMBER.0 - ERROR: Database connection is missing for transform [Database lookup NUMBER]! 2023/11/22 15:53:37 - Database lookup NUMBER.0 - ERROR: Error initializing transform [Database lookup NUMBER] 2023/11/22 15:53:37 - Database lookup VARCHAR.0 - ERROR: Database connection is missing for transform [Database lookup VARCHAR]! 2023/11/22 15:53:37 - Database lookup VARCHAR.0 - ERROR: Error initializing transform [Database lookup VARCHAR] 2023/11/22 15:53:37 - REPORT_KREDITORINFO_RUN.0 - Connected to database [ef3_reporting] (commit=1000) 2023/11/22 15:53:37 - REPORT_KREDITORINFO.0 - Connected to database [ef3_reporting] (commit=1000) 2023/11/22 15:53:37 - kreditorinfos_somedata - ERROR: Transform [Database lookup VARCHAR.0] failed to initialize! 2023/11/22 15:53:37 - kreditorinfos_somedata - ERROR: Transform [Database lookup NUMBER.0] failed to initialize! 2023/11/22 15:53:37 - Kreditorinfos.0 - Finished reading query, closing connection. 2023/11/22 15:53:37 - GetRUNID.0 - Finished reading query, closing connection.

you can see the Table Output is able to connect, but the Database Lookup cannot initalize

Issue Priority

Priority: 1

Issue Component

Component: Transforms

sramazzina commented 1 year ago

@Cupropituvanso that sounds strange to me. Can you please provide a reproduction path?

Please verify that, by opening the database connection metadata dialog box, the variables you set are correctly resolved (see picture below as an example

image

My fear is that you configured the variables incorrectly. I imagine the file you specify is an environment file. Are you sure you are referencing it correctly? The test I asked you above is useful to demonstrate that you set the things correctly. Let u know.

Cupropituvanso commented 1 year ago

Yes, this works, its the correct path resolving.

And starting the pipeline direct works, only via Workflow this error occurs.

sramazzina commented 1 year ago

Please can you provide us a sample that reproduce your problem so that we can have a look and investigate better? It's unclear to me why your issue is happening only when your pipeline is started from a workflow (if I not misunderstood what you said). Thank you for your cooperation

sramazzina commented 12 months ago

@Cupropituvanso any news about the availability of a reproduction path?

Cupropituvanso commented 12 months ago

Sorry, didn't get the last update ... I am not sure how to provide an example, because you would need the database connection to reproduce it, wouldn't you? Yes you understood correctly.

hansva commented 12 months ago

A reproductionpath with h2 or duckdb is also an option. Or the instructions on how you are working. "assume you have a database named foo" and it has been configured with an environment, or hard coded in the connection.