Issues Running a C++ cpprest API Server with HOOPS Libraries in AWS Lightsail Ubuntu 22.04 Environment


I am currently developing a C++ cpprest API server that utilizes the HOOPS Exchange and HOOPS Communicator libraries.

The project is containerized with Docker and operates normally when executed on a Mac using docker-compose. It has been implemented to read .stp files using HOOPS Exchange and to convert files into .scs, .scz, and .png formats with the HOOPS Communicator library.

However, I’ve encountered issues running it in the AWS Lightsail environment with Ubuntu 22.04, where it fails to launch. Even after setting debug_flags to 1 to identify the error, no logs are generated, and it only outputs exited with code 139.

I have implemented the server exactly as detailed in the code from the following link: How to use HOOPS Exchange with LibConverter for Stream Cache export

If anyone has experienced similar issues or has insights into what might be going wrong, your input would be greatly appreciated.

Thank you!

++ Lightsail 4 GB RAM, 2 vCPUs, 80 GB SSD

Hello @gyutae.k1020, first off welcome to the forum!

I know that knowledge base link is code only for Windows. Also, are the HOOPS Exchange and HOOPS Communicator the same version?

I think @kevin might have more insight as he wrote the original article you referenced

1 Like

Hello @gyutae.k1020,

One quick troubleshooting suggestion is to first run your Docker container without generating a PNG to see if that resolves the exited with code 139 error output.

This error could be a segmentation fault resulting from generating a PNG in a headless Linux environment. Please refer to our docs on running such an environment:



I am using the latest version of HOOPS Communicator and HOOPS Exchanger, which is the 2023_SP2_U2 Linux version.

Additionally, executing the converter binary file within the HOOPS Communicator project does not work either.

I read the document you provided and modified the code. As a result, the PNG was created successfully! Thank you.

For others’ reference, I’m sharing a part of the Dockerfile code that I modified.

RUN apt-get update \
    && apt-get install -y xvfb \
    && apt-get install -y libsdl1.2-dev \
    && apt-get clean

# The g++ compile command should go here.

CMD ["sh", "-c", "xvfb-run --auto-servernum -s '-screen 0 640x480x24' ./main.o"]

Thanks for sharing! I am sure someone else will find this useful :slight_smile:

1 Like