nextcloud / llm

A Nextcloud app that packages a large language model (Llama2 / GPT4All Falcon)
24 stars 2 forks source link

Directory /var/www/.local/share/man required for successful installation #44

Open blizzz opened 11 months ago

blizzz commented 11 months ago

During the repair step, python dependencies are fetched. On my server – Ubuntu 22.04 – however it fails due to missing directories:

     - ERROR: Failed to install python dependencies: Failed to install poetry: PATH=/var/www/minion/ovin-perm/apps/llm/python/bin:$PATH VIRTUAL_ENV=/var/www/minion/ovin-perm/apps/llm/pytho
n POETRY_CACHE_DIR=/var/www/minion/ovin-perm/apps/llm/python/.cache PIPX_HOME=/var/www/minion/ovin-perm/apps/llm/python PIPX_BIN_DIR=/var/www/minion/ovin-perm/apps/llm/python/bin/ /var/www
/minion/ovin-perm/apps/llm/python/bin/python3 /var/www/minion/ovin-perm/apps/llm/python/bin/pipx install poetry returned Traceback (most recent call last):                                 
  File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir                                                                                                                                
    self._accessor.mkdir(self, mode)                                                                                                                                                        
FileNotFoundError: [Errno 2] No such file or directory: '/var/www/.local/share/man'                                                                                                         

During handling of the above exception, another exception occurred:                                                                                                                         

Traceback (most recent call last):                                                                                                                                                          
  File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir                                                                                                                                
    self._accessor.mkdir(self, mode)                                                                                                                                                        
FileNotFoundError: [Errno 2] No such file or directory: '/var/www/.local/share'                                                                                                             

During handling of the above exception, another exception occurred: 
Traceback (most recent call last):                                                                                                                                                          
  File "/var/www/minion/ovin-perm/apps/llm/python/bin/pipx", line 8, in <module>                                                                                                            
    sys.exit(cli())                                                                                                                                                                         
  File "/var/www/minion/ovin-perm/apps/llm/python/lib/python3.10/site-packages/pipx/main.py", line 880, in cli                                                                              
    setup(parsed_pipx_args)                                                                                                                                                                 
  File "/var/www/minion/ovin-perm/apps/llm/python/lib/python3.10/site-packages/pipx/main.py", line 829, in setup                                                                            
    mkdir(constants.LOCAL_MAN_DIR)                                                                                                                                                          
  File "/var/www/minion/ovin-perm/apps/llm/python/lib/python3.10/site-packages/pipx/util.py", line 78, in mkdir                                                                             
    path.mkdir(parents=True, exist_ok=True)                                                                                                                                                 
  File "/usr/lib/python3.10/pathlib.py", line 1179, in mkdir                                                                                                                                
    self.parent.mkdir(parents=True, exist_ok=True)                                                                                                                                          
  File "/usr/lib/python3.10/pathlib.py", line 1179, in mkdir                                                                                                                                
    self.parent.mkdir(parents=True, exist_ok=True)                                                                                                                                          
  File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir                                                                                                                                
    self._accessor.mkdir(self, mode)                                                                                                                                                        
PermissionError: [Errno 13] Permission denied: '/var/www/.local'

It leaves the installation with python deps only partly downloaded, and any use of the model will fail, due to missing langchain.

I installed version 1.2.1, against 28 RC 4.

For the record, creating the directory (mkdir -p /var/www/.local/share/man, even without giving any permissions to www-data) and running sudo -u www-data php occ maintenance:repair solved that issue.

oparoz commented 10 months ago

Same OS, same behaviour, but on 27.1.5.

Nils160988 commented 10 months ago

Same error here on 28.0.1, and manual fix with creating the folder also works.