Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with setuptools_scm during install.sh #608

Closed
particitae opened this issue Jan 26, 2024 · 25 comments
Closed

Error with setuptools_scm during install.sh #608

particitae opened this issue Jan 26, 2024 · 25 comments

Comments

@particitae
Copy link

in a docker container
root@366ed453f862:/PhiloLogic4# ./install.sh

`./install.sh: 8: [[: not found

INSTALLING PYTHON LIBRARY

Processing /PhiloLogic4/python
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
/usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
/PhiloLogic4/python/.eggs/setuptools_scm-8.0.4-py3.10.egg/setuptools_scm/_integration/setuptools.py:30: RuntimeWarning:
ERROR: setuptools==59.6.0 is used in combination with setuptools_scm>=8.x

  Your build configuration is incomplete and previously worked by accident!
  setuptools_scm requires setuptools>=61
  
  Suggested workaround if applicable:
   - migrating from the deprecated setup_requires mechanism to pep517/518
     and using a pyproject.toml to declare build dependencies
     which are reliably pre-installed before running the build tools
  
    warnings.warn(
  WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/PhiloLogic4/python/setup.py", line 8, in <module>
      setup(
    File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.10/distutils/core.py", line 108, in setup
      _setup_distribution = dist = klass(attrs)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 459, in __init__
      _Distribution.__init__(
    File "/usr/lib/python3.10/distutils/dist.py", line 292, in __init__
      self.finalize_options()
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 837, in finalize_options
      ep(self)
    File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 858, in _finalize_setup_keywords
      ep.load()(self, ep.name, value)
    File "/PhiloLogic4/python/.eggs/setuptools_scm-8.0.4-py3.10.egg/setuptools_scm/_integration/setuptools.py", line 101, in version_keyword
      _assign_version(dist, config)
    File "/PhiloLogic4/python/.eggs/setuptools_scm-8.0.4-py3.10.egg/setuptools_scm/_integration/setuptools.py", line 56, in _assign_version
      _version_missing(config)
    File "/PhiloLogic4/python/.eggs/setuptools_scm-8.0.4-py3.10.egg/setuptools_scm/_get_version_impl.py", line 112, in _version_missing
      raise LookupError(
  LookupError: setuptools-scm was unable to detect version for /PhiloLogic4.
  
  Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
  
  For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
`

pip list

Package Version
gyp 0.1
packaging 23.2
pip 22.0.2
setuptools 59.6.0
setuptools-scm 8.0.4
tomli 2.0.1
typing_extensions 4.9.0
wheel 0.37.1

Perhaps there is a problem with the version of setuptools_scm.
Which version is recommended ?

@AnaisMazoue
Copy link

Hi,
Did you find a solution to fix this error ? I tried to install PhiloLogic4 and had the same issue..
Thanks !

@particitae
Copy link
Author

nope !!!!!

@clovis
Copy link
Contributor

clovis commented Apr 17, 2024

Hi, sorry for not getting back to you earlier!

I've just released a new version which changes the build system and should resolve the issue: https://github.com/ARTFL-Project/PhiloLogic4/releases/tag/v4.7.5.0

Let me know if you still have issues! Thanks!

@particitae
Copy link
Author

thanks for your work

In the Dockerfile, we should add python3.10-venv in the line RUN apt-get update && apt-get upgrade -y &&
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libxml2-dev libxslt-dev zlib1g-dev apache2 libgdbm-dev python3-pip liblz4-
tool brotli ripgrep gcc make python3-dev wget sudo nodejs npm python3.10-venv && \

and i don't find philoload4 after the installation.

@clovis
Copy link
Contributor

clovis commented Apr 24, 2024

Thanks for looking into this further!

After some digging, it appears that the python package was not being built correctly (and therefore not installed) due to an Ubuntu related issue (see pypa/setuptools#3269). The fix involves removing the python3-pip package (alongn with its dependencies, in particular python-setuptools), and then reinstalling pip manually:
wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py
The Dockerfile has been update to reflect that.

@particitae
Copy link
Author

ok
the installation ends correctly.
But
i got a blank screen.

def start_web_app(environ, start_response): """Return index.html to start web app""" config = WebConfig(os.path.abspath(PATH)) headers = [("Content-type", "text/html; charset=UTF-8"), ("Access-Control-Allow-Origin", "*")] if not config.valid_config: # This means we have an error in the webconfig file html_page = build_misconfig_page(config.traceback, "webconfig.cfg") else: request = WSGIHandler(environ, config) if config.access_control: if not request.authenticated: token = access_control.check_access(environ, config) if token: h, ts = token headers.append(("Set-Cookie", "hash=%s" % h)) headers.append(("Set-Cookie", "timestamp=%s" % ts)) with open(f"{config.db_path}/app/index.html") as index_page: html_page = index_page.read() start_response("200 OK", headers) return html_page
i correct the line :with open(f"{config.db_path}/app/index.html") as index_page:
i got any trace in access.log and error.log. Any idea to debug ?

@clovis
Copy link
Contributor

clovis commented Apr 25, 2024

You should not have to edit any code at this point to make things work. Did you build a PhiloLogic database? If so, could you paste the terminal output? Thanks!

@particitae
Copy link
Author

/usr/local/bin/philoload4 -D -d epigraphie /media/epigraphie/*;

`### Storing in database ###
Thu Apr 25 13:51:54 2024: Loading the sentences SQLite table...
Thu Apr 25 13:51:57 2024: Loading the lines SQLite table...
Thu Apr 25 13:51:57 2024: Loading the graphics SQLite table...
Thu Apr 25 13:51:57 2024: Loading the refs SQLite table...
Thu Apr 25 13:51:57 2024: Loading the pages SQLite table...
Thu Apr 25 13:51:57 2024: Loading the toms SQLite table...
Thu Apr 25 13:51:59 2024: Generating word frequencies...
Thu Apr 25 13:51:59 2024: Generating normalized word frequencies...
Thu Apr 25 13:51:59 2024: Generating metadata frequencies...
The following fields were not found in the input corpus options, type, n, id, vol, div_date, who, speaker, resp, facs, philo_div2_id, philo_div3_id
Thu Apr 25 13:51:59 2024: Generating normalized metadata frequencies...

Finishing up

wrote database info to /var/www/html/epigraphie/data/db.locals.py.
wrote Web application info to /var/www/html/epigraphie/data/web_config.cfg
Building Web Client Application... done.
Application viewable at https://philologic.lamop.fr/epigraphie
`

@clovis
Copy link
Contributor

clovis commented Apr 25, 2024

You are running this in a Docker container? I see that you have https enabled. Did you propagate the SSL config to the Apache instance inside the container? I'm thinking you may have a SSL handshake issue. My setup to run PhiloLogic in Docker behind SSL is to share the certificate between host and container and point to that certificate in the container Apache config.

@particitae
Copy link
Author

I tried on a local configuration in a docker instance.

root@2dda399120f5:/# curl http://localhost/philologic/epigraphie/

Same Error:

<script type="module" src="./philologic/epigraphie/app/src/main.js"></script> <title>PhiloLogic4</title> We're sorry but PhiloLogic4 doesn't work without JavaScript enabled. Please enable it to continue.

docker build -t philologic . , docker run -d philologic, etc...

It should be something obvious. Is there something i could test ?

@clovis
Copy link
Contributor

clovis commented May 13, 2024

Using curl won't work since you need client side (e.g. the browser) javascript. What does it show when you try in the browser?

@particitae
Copy link
Author

same thing

@clovis
Copy link
Contributor

clovis commented May 13, 2024

Do you have a browser extension blocking Javascript by any chance? Have you tried different browsers?

@particitae
Copy link
Author

Capture d’écran du 2024-05-13 17-16-51

i changed main.js path

@clovis
Copy link
Contributor

clovis commented May 13, 2024

Thanks! So you should not need to edit any paths.

it just occurred to me that you may have an issue with the global config file located in /etc/philologic/philologic4. Assuming you are running this on localhost, did you set url_root to "http://localhost/philologic/"?

@particitae
Copy link
Author

particitae commented May 13, 2024

yes

# Set the filesytem path to the root web directory for your PhiloLogic install.
database_root = "/var/www/html/philologic/"
# /var/www/html/philologic/ is conventional for linux,
# /Library/WebServer/Documents/philologic for Mac OS.

# Set the URL path to the same root directory for your philologic install.
url_root = "http://localhost/philologic/"
# http://localhost/philologic/ is appropriate if you don't have a DNS hostname.

## This should be set to the location of the PhiloLogic4 www directory
web_app_dir = '/var/lib/philologic4/web_app/'

@clovis
Copy link
Contributor

clovis commented May 13, 2024

OK, so the only other potential issue I can think of is with the Apache config. Did you enable mod_cgi and did you set AllowOverride to All for the /var/www directory. Something like this:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride all
        Require all granted
</Directory>```

@particitae
Copy link
Author

mod_cgi

a2enmod rewrite && a2enmod cgi && a2enmod brotli
Module rewrite already enabled
Your MPM seems to be threaded. Selecting cgid instead of cgi.
Module cgid already enabled
Module brotli already enabled

@particitae
Copy link
Author

apache2.conf

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted

@clovis
Copy link
Contributor

clovis commented May 13, 2024

Sorry to ask, but did you by any chance restart apache after setting up the config? If yes, then I admit I do not know what else could be wrong...
I do have a docker image on Dockerhub that does work (I use it in class with my students). Just run docker pull artfl/philologic
Perhaps you can compare the config there with what you have?

@particitae
Copy link
Author

the image artfl/philologic works !!!

the investigation continues

@clovis
Copy link
Contributor

clovis commented May 15, 2024

Good to hear! I'm very curious to find out what the cause of the issue is...

@particitae
Copy link
Author

my test

docker
sudo docker pull artfl/philologic
sudo docker run -p 80:80 -d artfl/philologic

inside the docker
wget https://github.com/ARTFL-Project/PhiloLogic4/archive/refs/tags/v4.7.5.4.tar.gz
mv /etc/philologic/philologic4.cfg /etc/philologic/philologic4.sav
tar -xvzf v4.7.5.4.tar.gz
apt-get update
apt install -f python3.10-venv
cd PhiloLogic4-4.7.5.4
./install.sh
mv /etc/philologic/philologic4.sav /etc/philologic/philologic4.cfg
cd /tmp
wget https://hmaot.lamop.fr/download/epigraphie.tar.gz
tar -xvzf epigraphie.tar.gz
philoload4 -c 16 -D -d epigraphie epigraphie/*

--> http://localhost/philologic/epigraphie KO

inside the docker
https://github.com/ARTFL-Project/PhiloLogic4/archive/refs/tags/v4.7.2.0.tar.gz
wget https://github.com/ARTFL-Project/PhiloLogic4/archive/refs/tags/v4.7.2.0.tar.gz
mv /etc/philologic/philologic4.cfg /etc/philologic/philologic4.sav
tar -xvzf v4.7.2.0.tar.gz
cd PhiloLogic4-4.7.2.0
./install.sh
mv /etc/philologic/philologic4.sav /etc/philologic/philologic4.cfg
cd /tmp
wget https://hmaot.lamop.fr/download/epigraphie.tar.gz
tar -xvzf epigraphie.tar.gz
philoload4 -c 16 -D -d epigraphie epigraphie/*

--> http://localhost/philologic/epigraphie OK

@clovis
Copy link
Contributor

clovis commented May 16, 2024

Thank you for the detailed message! So I was indeed able to replicate the issue, and it was related to the web application not building properly due to the default nodejs on Ubuntu 22.04 which is getting a bit old. The fix involves using a more recent version of node. I was able to run your corpus without issue once I built the image from the updated Dockerfile.

Thanks again!

@particitae
Copy link
Author

problem solved too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants