File does not create inside the docker container when Jetson Inference is running

Hi, i’m running a python code with Jetson Inference in Jetson Nano 4GB. Inside the code, i’m trying to create a file but, the file is not created.

File "", line 39, in <module>
    with open(file_path, 'w') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/usr/raw.txt'

the python code for creating the file is working without the usage of Jetson Inference.

How to resolve this error?

Thanks in advance.


Hi @pulzappcheck890, when you created the file, did you create it inside or outside the container? The container only sees files that are inside it, unless you mount them in.

For example, starting the jetson-inference container with docker/ --volume /home/usr:/mount will mount usr’s home directory to the location /mount inside the container. Hope that helps!

yes, i created outside the container. It was inside the /tmp folder. and the code is in a separate folder which is inside the docker container

Hi @dusty_nv , i tried to mount the folder as you instructed on the above message. Now the shmsink socket file is being generated in the mounted folder. Now, the socket file cannot be read inside a docker container or in the regular terminal to view the video feed

What can be the remedy for this ?

thanks in advance

Hi @pulzappcheck890, I’m not sure what you are referring to with the shmsink socket file? Perhaps change it’s path to one not in the mounted volume? Or make sure the permissions of the mounted volume are correct, and that it exists on an ext3/ext4 partition

Hi @dusty_nv,

We are using gstreamer’s shmsink to sink an input audio/video stream to a shared memory location(a file is created in the given location) that can be accessed using shmsrc to preview and use for other purposes.

We have tested this scenario by creating a python code to receive an rtsp stream and process it and sink the audio/video using shmsink and preview it using shmsrc which is working without any errors.

Now we are using jetson inference which is running inside a docker, to add some more processing like object detection to the same rtsp feed where everything is working fine. We also were able to create a shmsink file (shared memory file) inside a mounted folder in the docker after the video processing is done. The issue we have is accessing that file using shmsrc. It says permission is denied.

We also tried creating a text file from the same python code in the same location and it was accessible.

Is this a file permission issue when running inside the docker?
How can we resolve this error?

Or Can we use the jetson inference building and installation without docker and try if the same issue exists?

Thanks in advance.

Hi @pulzappcheck890, I’m not familiar with the specifics of what you are doing with shmsink and shared memory sockets, however yes - you can just build jetson-inference from source outside of container and try it that way if you want:

Typically when you create a file in container, it is created with root write-only privileges (unless you specifically created another used in your container). I don’t believe this prevents other uses from reading the files though. You can manually set the file access rights with chmod/ect though (I’m not sure about special shared memory files). You could also try creating your file in a different container (like l4t-base) just a test to see if the behavior is the same or not.

1 Like

We will try these methods and see

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.