haiwen / seafile-docker

A Docker image for Seafile server
Other
536 stars 180 forks source link

Casting port to int breaks in bootstrap.py #373

Closed ragekit closed 5 months ago

ragekit commented 5 months ago

Hey all ! In reference, forum post : https://forum.seafile.com/t/error-when-using-docker-in-bootstrap-py-typeerror-expected-str-bytes-or-os-pathlike-object-not-int/19248

Cating to int the port number in : https://github.com/haiwen/seafile-docker/blob/3d92b4dad60525f88b039c6c425dc0fa45d2a90d/scripts/scripts_11.0/bootstrap.py#L149 is breaking install on my raspberry pi 4, works fine if I edit to use a string instead of an int. I think @SkywalkerSpace made this change according to git blame.

callstack :

 | Traceback (most recent call last):
seafile            |   File "/scripts/start.py", line 95, in <module>
seafile            | waiting for mysql server to be ready: %s (2003, "Can't connect to MySQL server on 'db' ([Errno 111] Connection refused)")
seafile            |     main()
seafile            |   File "/scripts/start.py", line 59, in main
seafile            |     init_seafile_server()
seafile            |   File "/scripts/bootstrap.py", line 166, in init_seafile_server
seafile            |     call('{} auto -n seafile'.format(setup_script), env=env)
seafile            |   File "/scripts/utils.py", line 70, in call
seafile            |     return subprocess.check_call(*a, **kw)
seafile            |   File "/usr/lib/python3.10/subprocess.py", line 364, in check_call
seafile            |     retcode = call(*popenargs, **kwargs)
seafile            |   File "/usr/lib/python3.10/subprocess.py", line 345, in call
seafile            |     with Popen(*popenargs, **kwargs) as p:
seafile            |   File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
seafile            |     self._execute_child(args, executable, preexec_fn, close_fds,
seafile            |   File "/usr/lib/python3.10/subprocess.py", line 1783, in _execute_child
seafile            |     env_list.append(k + b'=' + os.fsencode(v))
seafile            |   File "/usr/lib/python3.10/os.py", line 811, in fsencode
seafile            |     filename = fspath(filename)  # Does type-checking of `filename`.
seafile            | TypeError: expected str, bytes or os.PathLike object, not int
ragekit commented 5 months ago

just to confirm docker image version 11.0.4

works perfectly

Gabrielx117 commented 5 months ago

https://forum.seafile.com/t/error-when-using-docker-in-bootstrap-py-typeerror-expected-str-bytes-or-os-pathlike-object-not-int/19248 改成 'MYSQL_PORT': get_conf('DB_PORT', '3306'),

ragekit commented 5 months ago

I know this is me in the forum !

SkywalkerSpace commented 5 months ago

Thanks for your feedback, we have updated the seafileltd/seafile-mc:latest image. You can install Seafile by docker pull seafileltd/seafile-mc:latest and then execute docker compose up