FlexTable UDF's broken (Failure in UDx RPC call InvokeSetExecContext(): failed to map segment from s

I'm attempting to use a Flex table in Vertica 7 community edition (although we currently have a demo Enterprise license) and running into this error that I can't dig up any info on:

Here is an example of me trying to follow along (but with my own data) showing the errors I'm getting. I tossed in a few exploratory queries based on other threads I read too.
[root@dw01 ~]# su verticadba -  [verticadba@dw01 root]# vsql  Password:  Welcome to vsql, the Vertica Analytic Database interactive terminal.    Type:  \h or \? for help with vsql commands         \g or terminate with semicolon to execute query         \q to quit    verticadba=> \dt ck.tracking_events_flex  No matching relations found.  verticadba=> create flex table ck.tracking_events_flex();  CREATE TABLE  verticadba=> \dt ck.tracking_events_flex                          List of tables   Schema |         Name         | Kind  |   Owner    | Comment  --------+----------------------+-------+------------+---------   ck     | tracking_events_flex | table | verticadba |  (1 row)    verticadba=> \d ck.tracking_events_flex                                                      List of Fields by Tables   Schema |        Table         |    Column    |          Type          |  Size  | Default | Not Null | Primary Key | Foreign Key  --------+----------------------+--------------+------------------------+--------+---------+----------+-------------+-------------   ck     | tracking_events_flex | __identity__ | int                    |      8 |         | t        | f           |   ck     | tracking_events_flex | __raw__      | long varbinary(130000) | 130000 |         | t        | f           |  (2 rows)    verticadba=> copy ck.tracking_events_flex from '/db/data/extract_tmp/tracking_events.json' parser fjsonparser();  ERROR 2858:  Could not find function definition  HINT:  This usually happens due to missing or corrupt libraries, libraries built with the wrong SDK version, or due to a concurrent session dropping the library or function. Try recreating the library and function  verticadba=> SELECT * FROM user_library_manifest;  ERROR 3399:  Failure in UDx RPC call InvokeSetExecContext(): Error calling setupExecContext() in User Defined Object [] at [/scratch_a/release/vbuild/vertica/OSS/UDxFence/vertica-udx-C++.cpp:180], error code: 0, message: Error happened in dlopen(): [/db/data/vertica/ck/v_ck_node0001_catalog/Libraries/public_FlexTableLib_45035996273732866.so: failed to map segment from shared object: Operation not permitted]  verticadba=> SELECT * FROM user_libraries;   schema_name |    lib_name    |      lib_oid      |        author         |     owner_id      |               lib_file_name                |             md5_sum              | sdk_version | revision | lib_build_tag | lib_version | lib_sdk_version |       source_url        |             description             |   licenses_required   | signature  -------------+----------------+-------------------+-----------------------+-------------------+--------------------------------------------+----------------------------------+-------------+----------+---------------+-------------+-----------------+-------------------------+-------------------------------------+-----------------------+-----------   public      | FlexTableLib   | 45035996273732866 | HP Vertica            | 45035996273704962 | public_FlexTableLib_45035996273732866.so   | ec0d0d1300b5868fba7e0cf5b78f4e2d | v7.0.0-1    | 127765   | 127765        | 1.0.0       | v7.0.0          | http://www.vertica.com/ | Flexible Tables Data Load and Query | com.vertica.flextable | 127765   public      | ApproximateLib | 45035996273733072 | Vertica Systems, Inc. | 45035996273704962 | public_ApproximateLib_45035996273733072.so | 025d17e62518e156e8bad1c7ce1e3d9a | v7.0.0-1    | 127765   |               | 1.0         | v7.0.0          | http://www.vertica.com/ | Approximate package                 |                       |  (2 rows)    verticadba=> \q  [verticadba@dw01 root]# ls -alh /db/data/extract_tmp/tracking_events.json  -rw-rw-r-- 1 verticadba verticadba 52M Apr  8 15:32 /db/data/extract_tmp/tracking_events.json  [verticadba@dw01 root]#
What's my next step here? The os is CentOS6.5 x86_64. This was a fresh install at version 7 and has never been upgraded from any other version.


  • "Failed to map segment from shared object: Operation not permitted" is a general Linux error which usually means you don't have permissions to the .so you're trying to utilize, in this case public_FlexTableLib_45035996273732866.so in {CatalogDirectory}/Libraries/
    Make sure your dbadmin user (or whatever user you're running Vertica as) has permissions to the .so on all nodes and that your catalog directory isn't on a disk mounted with the "noexec" option.

  • Thanks for the help James.  It is our policy to use "noexec" on all data partitions, including Vertica's.

    I was able to temporarily symlink the Libraries directory from a different partition which fixed the "Operation not permitted" issue when selecting from user_library_manifest .  We are still, however, getting this error:
    verticadba=> copy tracking_events_flex from '/db/data/extract_tmp/tracking_events.json' parser fjsonparser();  ERROR 2858:  Could not find function definition  HINT:  This usually happens due to missing or corrupt libraries, libraries built with the wrong SDK version, or due to a concurrent session dropping the library or function. Try recreating the library and function
    Do you have instructions on how to recreate the flextable library?  Also, is there any plan to remove executables from Vertica's data directory?
  • Hi Jason,

    The installer for Flex can be found in /opt/vertica/packages/.

    We install a number of packages this way.  If mounting "noexec" has corrupted this one, the others are likely corrupt as well.  You can reinstall them all manually (they are all in /opt/vertica/packages/).  Alternatively, if this is a new cluster that you haven't yet used significantly, you're likely to get better results by reinstalling from scratch.

    Managing executable content, as a part of our UDx extensions framework (see http://vertica.com/marketplace) and as part of various integrations between Vertica and other products, is a core functionality of Vertica that many of our users depend on.  Vertica provides its own access-control mechanisms for these libraries; it doesn't expect Linux file permissions to be used to control access.  It is true that there are multiple ways to provide this functionality; also that features shipped with the core product could be treated differently.  I can't speak to our future road map here; if you have a demo EE license, though, most likely you have a sales contact?, so I would suggest getting in touch with them if you would like to know more about future plans.

  • To give a bit more specifics on Adam's post: The simplest way to re-install the FlexTables package is via admintools: /opt/vertica/bin/admintools -t install_package -P flextable -d {YourDBName} If that fails, you can also install Flex manually by running the script: /opt/vertica/packages/flextable/ddl/install.sql Also, to clarify, the catalog directory which contains the .so is different from the data directory containing your DB data. The only data within the catalog directory is metadata and logs.
  • We were able to re-install the FlexTables package and get it working!  Thanks James and Adam.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file