[Errno 13] Permission denied Error when publishing

Hi everyone! I am trying to publish my streamlit app and am running into the error:

PermissionError: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 125, in worker    result = (True, func(*args, **kwds))  File "/mount/src/fireoccurrenceprediction/Home.py", line 147, in runHumanFOPModel    raise Exception(e)Exception: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'"""The above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/mount/src/fireoccurrenceprediction/Home.py", line 356, in run_human_fop_model    result.get()  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 771, in get    raise self._valueException: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'

My code uses a mix of python and C files and I am attempting to call the C executable cf-build-AB.exe which is raising the permission error.

Here is a link to my App Link

And this is my code:

In Home.py

from lightning import LightningFireOccurrencePrediction
from human import HumanFireOccurrencePrediction

And then in the HumanFireOccurrencePrediction Class


 # Build the path to the C weather interpolation executable.
        self.weather_interpolation_exe_path = \
            os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'FireOccurrencePrediction\\lightning\\weather\\cf-build-AB.exe'))
        
        # Build the path to the C weather binning executable.
        self.weather_binning_exe_path = \
            os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'FireOccurrencePrediction\\lightning\\weather\\use_cf2.exe'))
    
    def weatherInterpolationBinnerWrapper(self):
        """ Calls the wrapped weather interpolation and binning tools, feeding it the massaged weather data.
            Here, we use subprocess.call as opposed to subprocess.Popen because subprocess.call
            is blocking; we need the external call to finish before we carry on with other stages of
            the processing flow. """
        
        # print("weatherInterpolationBinnerWrapper(): Calling weather interpolation exe...")
        # print("weatherInterpolationBinnerWrapper(): self.hmn_weather_interpolation_coefficients_path is %s" % self.hmn_weather_interpolation_coefficients_path)

        subprocess.call([self.weather_interpolation_exe_path, self.hmn_weather_massaged_output_path, self.hmn_weather_interpolation_coefficients_path])
        # print("weatherInterpolationBinnerWrapper(): Weather interpolation exe call completed.")

        # print("weatherInterpolationBinnerWrapper(): Calling weather binner exe...")
        subprocess.call([self.weather_binning_exe_path, self.hmn_weather_binned_output_path, self.hmn_grid_locations_path, self.hmn_weather_interpolation_coefficients_path])
        # print("weatherInterpolationBinnerWrapper(): Weather binning exe call completed.")

Hello I am having the following error on my published streamlit App:

PermissionError: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 125, in worker    result = (True, func(*args, **kwds))  File "/mount/src/fireoccurrenceprediction/Home.py", line 147, in runHumanFOPModel    raise Exception(e)Exception: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'"""The above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/mount/src/fireoccurrenceprediction/Home.py", line 356, in run_human_fop_model    result.get()  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 771, in get    raise self._valueException: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'

My code contains both C and Python files. I am attempting to use my executable C file cf-build-AB.exe but am getting a permission error. Note that the code works locally just not on the published App.

This is a link to the published App - Link

I get the error in the following code:

 # Build the path to the C weather interpolation executable.
        self.weather_interpolation_exe_path = \
            os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'FireOccurrencePrediction\\lightning\\weather\\cf-build-AB.exe'))
        
        # Build the path to the C weather binning executable.
        self.weather_binning_exe_path = \
            os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'FireOccurrencePrediction\\lightning\\weather\\use_cf2.exe'))
    
    def weatherInterpolationBinnerWrapper(self):
        """ Calls the wrapped weather interpolation and binning tools, feeding it the massaged weather data.
            Here, we use subprocess.call as opposed to subprocess.Popen because subprocess.call
            is blocking; we need the external call to finish before we carry on with other stages of
            the processing flow. """
        
        # print("weatherInterpolationBinnerWrapper(): Calling weather interpolation exe...")
        # print("weatherInterpolationBinnerWrapper(): self.hmn_weather_interpolation_coefficients_path is %s" % self.hmn_weather_interpolation_coefficients_path)

        subprocess.call([self.weather_interpolation_exe_path, self.hmn_weather_massaged_output_path, self.hmn_weather_interpolation_coefficients_path])
        # print("weatherInterpolationBinnerWrapper(): Weather interpolation exe call completed.")

        # print("weatherInterpolationBinnerWrapper(): Calling weather binner exe...")
        subprocess.call([self.weather_binning_exe_path, self.hmn_weather_binned_output_path, self.hmn_grid_locations_path, self.hmn_weather_interpolation_coefficients_path])
        # print("weatherInterpolationBinnerWrapper(): Weather binning exe call completed.")

Hi Everyone! I am trying to publish my streamlit App and am running into the error

PermissionError: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 125, in worker    result = (True, func(*args, **kwds))  File "/mount/src/fireoccurrenceprediction/Home.py", line 147, in runHumanFOPModel    raise Exception(e)Exception: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'"""The above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/mount/src/fireoccurrenceprediction/Home.py", line 356, in run_human_fop_model    result.get()  File "/usr/local/lib/python3.9/multiprocessing/pool.py", line 771, in get    raise self._valueException: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.exe'

My code uses a mix of python and C files and the error is raised when I call the executable cf-build-AB.exe (which is the exe of my C file) in my code. If anyone has any ideas of why this error is occurring the help would be greatly appreciated!

A link to the App - Link

My code portion that associates with the error is below

starting in Home.py:


from lightning import LightningFireOccurrencePrediction
from human import HumanFireOccurrencePrediction

and in HumanFireOccurrencePrediction:

 self.weather_interpolation_exe_path = \
            os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'FireOccurrencePrediction\\lightning\\weather\\cf-build-AB.exe'))
        
        # Build the path to the C weather binning executable.
        self.weather_binning_exe_path = \
            os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), 'FireOccurrencePrediction\\lightning\\weather\\use_cf2.exe'))
    
    def weatherInterpolationBinnerWrapper(self):
        """ Calls the wrapped weather interpolation and binning tools, feeding it the massaged weather data.
            Here, we use subprocess.call as opposed to subprocess.Popen because subprocess.call
            is blocking; we need the external call to finish before we carry on with other stages of
            the processing flow. """
        
        # print("weatherInterpolationBinnerWrapper(): Calling weather interpolation exe...")
        # print("weatherInterpolationBinnerWrapper(): self.hmn_weather_interpolation_coefficients_path is %s" % self.hmn_weather_interpolation_coefficients_path)

        subprocess.call([self.weather_interpolation_exe_path, self.hmn_weather_massaged_output_path, self.hmn_weather_interpolation_coefficients_path])
        # print("weatherInterpolationBinnerWrapper(): Weather interpolation exe call completed.")

        # print("weatherInterpolationBinnerWrapper(): Calling weather binner exe...")
        subprocess.call([self.weather_binning_exe_path, self.hmn_weather_binned_output_path, self.hmn_grid_locations_path, self.hmn_weather_interpolation_coefficients_path])
        # print("weatherInterpolationBinnerWrapper(): Weather binning exe call completed.")

You cannot execute an .exe file in Debian, which is the operating system used in Streamlit Cloud.

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