Skip to main content

Failure in UDx RPC call InvokeSetExecContext()

  • July 16, 2013
  • 13 replies
  • 34 views

Mark_Rees
When running the demo code for a user defined function in R, it produces the following error. This error is not documented anywhere in the documentation, does anyone have any idea what it means? (This used to work, but now fails, so our production servers are all down). dbadmin=> create library mark as '/home/dbadmin/v_lib/R/mul.r'; ROLLBACK 3399: Failure in UDx RPC call InvokeSetExecContext(): Error calling setupContext() in User Defined Object [] at [/scratch_a/release/vbuild/vertica/UDxFence/vertica-udx-C++.cpp:132], error code: 0, message: Error happened in dlopen(): [/home/dbadmin/v_lib/R/mul.r: invalid ELF header]

13 replies

Forum|alt.badge.img+2
  • Participating Frequently
  • July 16, 2013
Hi Mark, "invalid ELF header" is a C++-UDx error. (Well, a native-library error; Vertica supports native libraries written in C++.) It looks like you've tried to load the library as a C++ library. In your CREATE LIBRARY statement, you should specify 'R' as the language. Adam

shiva_kumar
  • New Participant
  • August 8, 2013
Hi I am getting the below error while running install.sql file in order to connect mysql with vertica vsql:/home/Techm/Desktop/vertica_extention_packages/odbc_loader_package/ddl/install.sql:2: ROLLBACK 3399: Failure in UDx RPC call InvokeSetExecContext(): Error calling setupContext() in User Defined Object [] at [/scratch_a/release/vbuild/vertica/UDxFence/vertica-udx-C++.cpp:132], error code: 0, message: Error happened in dlopen(): [/home/Techm/Desktop/Vertica/build/ODBCLoader.so: cannot open shared object file: No such file or directory] vsql:/home/Techm/Desktop/vertica_extention_packages/odbc_loader_package/ddl/install.sql:3: ROLLBACK 3861: Library not found: ODBCLoaderLib vsql:/home/Techm/Desktop/vertica_extention_packages/odbc_loader_package/ddl/install.sql:4: ROLLBACK 3861: Library not found: ODBCLoaderLib Please help me......

Forum|alt.badge.img+2
  • Participating Frequently
  • August 8, 2013
Hi Shiva, Hm... There's a lot of boilerplate in that error message. The actual error in all that text is: [/home/Techm/Desktop/Vertica/build/ODBCLoader.so: cannot open shared object file: No such file or directory] Are you following the installation instructions in the README file in the odbc_loader_package directory? In particular, I'd recommend installing by running "make install" in the odbc_loader_package directory. This package (like everything on github) is distributed as source code only; "make install" does all the work of first compiling it, then installing it into Vertica, in a single step. Incidentally, once you do get the ODBC loader working: The package was just released recently; we'd be very curious for any feedback you have on it. We can test it all we want in the lab; things are always a little different in the real world, especially with tools like connectors which have to interface with complex existing systems. Thanks, Adam

shiva_kumar
  • New Participant
  • August 12, 2013
Hi Adam Thanks for your response...... I am getting below error when i run this query in vertica........ Query:COPY sample.test123 WITH SOURCE ODBCSource() PARSER ODBCLoader(connect='DSN=Connect', query='SELECT * FROM test.student;'); Error:ERROR 0: Error calling setup() in User Function UDParser at [ODBCLoader.cpp:213 ], error code: 0, message: ODBC Error: SQLDriverConnect() failed with error code IM002, native code 0 [[unixODBC][Driver Manager]Data source name not found, and no default driver specified] please help me....

Forum|alt.badge.img+2
  • Participating Frequently
  • August 12, 2013
Hi Shiva, This is an ODBC configuration error; it's telling you that the Data source name (aka "DSN") that you specified isn't defined in the ODBC configuration on at least one of your Vertica nodes. Typically the node that you connected to to run the COPY statement. The ODBC Loader requires that ODBC be configured on all nodes in your cluster. (If you're configuring it per-user rather than systemwide, make sure it works for your dbadmin user on each node.) What I generally do is, I download and install "isql", a command-line ODBC client that's available in most Linux distributions' repositories; then play around until I can run "isql " (in your case, "isql Connect") and get a working SQL prompt on the database that you want to load from. Once I have that working on one machine (if it's a multi-node cluster), I copy the config files around, then quickly try out isql on the rest. Once isql is working with that syntax, the ODBC Loader should work as well. In terms of how to configure ODBC/isql, we can try to help with that, but you're typically configuring it for MySQL or Oracle or some non-Vertica system, so you might have better luck asking in that forum. Hope that helps, Adam

shiva_kumar
  • New Participant
  • August 13, 2013
Hi Adam, Thanks for your reply.... I made ODBC configurations as you told,but i am getting another error when trying to run the below same query. Query:COPY sample.test123 WITH SOURCE ODBCSource() PARSER ODBCLoader(connect='DSN=Connect', query='SELECT * FROM test.student;'); Error:[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed [ISQL]ERROR: Could not SQLConnect Help me.......

Forum|alt.badge.img+2
  • Participating Frequently
  • August 14, 2013
Hi Shiva, Hm... Out of curiosity, what type of database are you trying to connect to? (MySQL? SQL Server? Just to name a few.) Also, did you have to configure anything outside of /etc/odbc.ini, in order to get isql to work? (For example, an environment variable, etc.) Or did you have to pass isql any command-line arguments other than the DSN? That error is coming from the other database's ODBC driver; it's erroring out, we're just reporting the error. It's not an error that I've seen before. Looking around online, it looks like it can have various different causes, but it typically has to do with some bit of ODBC configuration being missing. We're glad to keep trying to help if we can, but since the error is coming from the other database's ODBC driver, you might have better luck asking in their forums. Adam

shiva_kumar
  • New Participant
  • August 21, 2013
Hi Adam, I am able to connect to isql [root@INBAAMPC02675 ~]# isql -v myodbc5 +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select * from test.student; +------------+----------------------------------------------+ | ID | NAME | +------------+----------------------------------------------+ | 1 | NAZIM | | 2 | Shiva | | 3 | Kavya | | 4 | New Student | | 5 | New Student 1 | +------------+----------------------------------------------+ but when trying to run below copy command i am getting following error Query:COPY sample.test123 WITH SOURCE ODBCSource() PARSER ODBCLoader(connect='DSN=myodbc5',query='select * from test.student;'); Error:server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. Help me..........

Matthew_1
  • New Participant
  • January 22, 2015
Hi Adam,  We are having a similar issue with a new installation of Vertica.

I tried to create a library with the information that we needed:
CREATE LIBRARY PIEXPFunctions AS '/opt/vertica/udflib/piexp_udf.so' ;ROLLBACK 3399:  Failure in UDx RPC call InvokeSetExecContext(): Error calling setupContext() in User Defined Object [] at [/scratch_a/release/vbuild/vertica/UDxFence/vertica-udx-C++.cpp:132], error code: 0, message: Error happened in dlopen(): [/opt/vertica/udflib/piexp_udf.so: file too short]

I have tried this a number of ways but it is not clear what is too short.  It is a brand new / empty lib file.

Any help you could give would be greatly appreciated.  Thanks.

--Matthew

id10t
Forum|alt.badge.img
  • Participating Frequently
  • January 22, 2015
Hi!

Check dlopen outside to Vertica.


source code - http://pastebin.com/kK0Z8CT1 (file: /tmp/dl.cpp)

compile:
g++ -I/usr/local/include -I/opt/vertica/sdk/include/ dl.cpp -Wl,--no-as-needed -ldl
verify:
daniel@synapse:~$ g++ -I/usr/local/include -I/opt/vertica/sdk/include/ /tmp/dl.cpp -Wl,--no-as-needed -ldl
daniel@synapse:~$ /tmp/a.out
dlopen .. OK

PS

Function/Library Gaussian.so you can find here - http://pastebin.com/gDPcQTE5
but you should define your path to "piexp_udf.so" instead of "/tmp/Gaussian.so" in line:
handle = dlopen ("/tmp/Gaussian.so", RTLD_LAZY);

Matthew_1
  • New Participant
  • January 22, 2015
The way i understand the command '/opt/vertica/udflib/piexp_udf.so' should have defined the path and the file location based on the example commands from the manual.  Am I incorrect?  I will try to compile the indicated include file.  Thanks a bunch for the quick response.

id10t
Forum|alt.badge.img
  • Participating Frequently
  • January 22, 2015
Hi!

Path for UDF isn't important. Vertica runs with root privileges so UDF can be located in any path.

When you creates a library from UDF, Vertica copies an UDF to appropriate folder.

Example:

I created an UDF - NormalDistribution.cpp(see link from my post above), compiled a library with name Gaussian.so
daniel@synapse:/vertica/dev/v_dev_node0001_catalog/Libraries/public_Gaussian_45035996275180212$ ls
public_Gaussian_45035996275180212.so
as you can see Vertica puts a library to catalog folder.

PS
And I did a test - compiled as root and as regular user - no difference, everything works fine.
BTW: I suggested to check dlopen outside to Vertica just to check that library coded and compiled well.
Also check linker, sometimes GNU linker can't find a library to link UDF.
Example:
$ ld Gaussian.so 
ld: warning: cannot find entry symbol _start; not setting start address

Regards

soc_magpie
  • New Participant
  • May 26, 2016

Hi, I received this error message when trying to install the PlaceLib. In my situation, vertica is installed in a three node cluster, however, the installation seems to be failed in one of the node. My error message looks like below:

\i install.sql
CREATE TYPE
CREATE TYPE
vsql:install.sql:12: ROLLBACK 2175: An error occurred when loading library file on node v_bamboo_node0002, message:
Failure in UDx RPC call InvokeSetExecContext(): Error calling setupExecContext() in User Defined Object [] at [/scratch_a/release/30493/vbuild/vertica/OSS/UDxFence/vertica-udx-C++.cpp:195], error code: 0, message: Error happened in dlopen(): [libgeos_c.so.1: cannot open shared object file: No such file or directory]
vsql:install.sql:19: ROLLBACK 3861: Library not found: public.PlaceLib
vsql:install.sql:20: ROLLBACK 3861: Library not found: public.PlaceLib
vsql:install.sql:21: ROLLBACK 3861: Library not found: public.PlaceLib
vsql:install.sql:22: ROLLBACK 3861: Library not found: public.PlaceLib
vsql:install.sql:23: ROLLBACK 3861: Library not found: public.PlaceLib
vsql:install.sql:24: ROLLBACK 3861: Library not found: public.PlaceLib
vsql:install.sql:25: ROLLBACK 3861: Library not found: public.PlaceLib
vsql:install.sql:26: ROLLBACK 3861: Library not found: public.PlaceLib