Why do I get 'User storage is not valid' error when I create a DDS Entity

The multiple APIs of Connext have an internal concept named User Storage, which is used to store API-specific data required for certain features.
This concept is normally part of the DomainParticipant entities and is configured through code as a QoS.

While the APIs will configure this concept transparently to the user, you may see errors such as "User storage is not valid" when mixing Entities created from different APIs, for example:

User storage is not valid, see https://community.rti.com/node/6411/

One possible scenario could be using the Modern C++ API with a DomainParticipant created using the C API. For example:

/* C Participant is created but not deleted */
c_participant = DDS_DomainParticipantFactory_create_participant(...);

/* Modern C++ Participant is looked up */
cxx_participant = rti::domain::find_participant_by_name(...);

/* Modern C++ Topic is created with previous Modern C++ Participant */
cxx_topic = dds::topic::Topic<...>(cxx_participant, ...); /* <-- potential exception */

One potential occurrence of this happening is when integrating a ROS Application (using the Connext RMW, written using the C API) with the Modern C++ API.
In general, you should not mix different Connext APIs, but if your use case requires it, please consider contacting RTI Support through the Support Portal or by emailing support@rti.com.

Keywords: