Rebuild image giving error

i am trying to rebuilt image to apply new custom theme using below command
tutor images build openedx
i am getting below error, i tried running quickstart, and restart few times but same error
any advise will be highly appreciated

content = pattern.sub(converter, content)                                                                                                                                  
  File "/openedx/edx-platform/openedx/core/djangoapps/theming/storage.py", line 219, in converter                                                                              
    hashed_url = self._url(                                                                                                                                                    
  File "/openedx/edx-platform/openedx/core/djangoapps/theming/storage.py", line 176, in _url                                                                                   
    return super()._url(hashed_name_func, processed_asset_name, force, hashed_files)                                                                                           
  File "/openedx/venv/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 132, in _url                                                                    
    hashed_name = hashed_name_func(*args)                                                                                                                                      
  File "/openedx/venv/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 343, in _stored_name                                                            
    cache_name = self.clean_name(self.hashed_name(name))                                                                                                                       
  File "/openedx/edx-platform/openedx/core/storage.py", line 24, in hashed_name                                                                                                
    out = super(PipelineForgivingMixin, self).hashed_name(name, content, **kwargs)  # lint-amnesty, pylint: disable=super-with-arguments                                       
  File "/openedx/venv/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 92, in hashed_name                                                              
    if not self.exists(filename):                                                                                                                                              
  File "/openedx/venv/lib/python3.8/site-packages/django/core/files/storage.py", line 317, in exists                                                                           
    return os.path.exists(self.path(name))                                                                                                                                     
  File "/openedx/venv/lib/python3.8/site-packages/django/contrib/staticfiles/storage.py", line 47, in path                                                                     
    return super().path(name)                                                                                                                                                  
  File "/openedx/venv/lib/python3.8/site-packages/django/core/files/storage.py", line 330, in path                                                                             
    return safe_join(self.location, name)                                                                                                                                      
  File "/openedx/venv/lib/python3.8/site-packages/django/utils/_os.py", line 44, in safe_join                                                                                  
    raise SuspiciousFileOperation(                                                                                                                                             
django.core.exceptions.SuspiciousFileOperation: The joined path (/openedx/images/NoCourseImage9ANxrE7.png) is located outside of the base path component (/openedx/staticfiles)
Traceback (most recent call last):                                                                                                                                             
  File "/openedx/bin/openedx-assets", line 218, in <module>                                                                                                                    
    main()                                                                                                                                                                     
  File "/openedx/bin/openedx-assets", line 89, in main                                                                                                                         
    args.func(args)                                                                                                                                                            
  File "/openedx/bin/openedx-assets", line 157, in run_collect                                                                                                                 
    assets.collect_assets(args.systems, args.settings)                                                                                                                         
  File "/openedx/edx-platform/pavelib/assets.py", line 717, in collect_assets                                                                                                  
    sh(django_cmd(sys, settings, "collectstatic {ignore_args} --noinput {logfile_str}".format(                                                                                 
  File "/openedx/venv/lib/python3.8/site-packages/paver/shell.py", line 60, in sh                                                                                              
    return dry(command, runpipe)                                                                                                                                               
  File "/openedx/venv/lib/python3.8/site-packages/paver/easy.py", line 15, in dry                                                                                              
    return func(*args, **kw)                                                                                                                                                   
  File "/openedx/venv/lib/python3.8/site-packages/paver/shell.py", line 55, in runpipe                                                                                         
    raise BuildFailure("Subprocess return code: %d" % p.returncode)                                                                                                            
paver.tasks.BuildFailure: Subprocess return code: 1                                                                                                                            
The command '/bin/sh -c openedx-assets themes     && openedx-assets collect --settings=tutor.assets     && rdfind -makesymlinks true -followsymlinks true /openedx/staticfiles/
' returned a non-zero code: 1
Error: Command failed with status 1: docker build -t docker.io/overhangio/openedx:12.0.2 /home/tabrezg/.local/share/tutor/env/build/openedx

This error message tells you the problem. It sounds like you are trying to include a file that is outside of theme directory. You can look at the structure of the themes to verify the files are in the correct locations. Configuration and customisation — Tutor documentation.

thanks @tony-h i was able to resolve this issue after removing those external references

1 Like