Error when starting seafile-mc 7.1.3

Hello,
I am currently getting the following error when I start the seafile-mc (version 7.1.3) docker container:

*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 21
*** Running /scripts/start.py...
[2020-04-20 18:06:12] Preparing for letsencrypt ...
Traceback (most recent call last):
  File "/scripts/start.py", line 86, in <module>
    main()
  File "/scripts/start.py", line 51, in main
    init_letsencrypt()
  File "/scripts/bootstrap.py", line 32, in init_letsencrypt
    wait_for_nginx()
  File "/scripts/utils/__init__.py", line 288, in wait_for_nginx
    if ':80 ' in output:

The problem seems to be that ‘:80’ should be changed to b’:80’ as subprocess returns a bytestring in Python 3.

same problem with seafile-mc-pro 7.1.3

*** Booting runit daemon...
*** Runit started as PID 25
*** Running /scripts/start.py...
[2020-04-22  16:22:19] Preparing for letsencrypt ...
Traceback (most recent call last):
  File "/scripts/start.py", line 86, in <module>
    main()
  File "/scripts/start.py", line 51, in main
    init_letsencrypt()
  File "/scripts/bootstrap.py", line 32, in init_letsencrypt
    wait_for_nginx()
  File "/scripts/utils/__init__.py", line 288, in wait_for_nginx
    if ':80 ' in output:
TypeError: a bytes-like object is required, not 'str'

i do receive the same error (|SEAFILE_VERSION |7.1.3|):

*** Running /etc/my_init.d/01_create_data_links.sh…

rm: cannot remove '/var/log/nginx': Device or resource busy


*** Booting runit daemon...


*** Runit started as PID 23


*** Running /scripts/start.py...


[2020-04-25 12:34:41] Preparing for letsencrypt ...


Traceback (most recent call last):


  File "/scripts/start.py", line 86, in <module>


    main()


  File "/scripts/start.py", line 51, in main


    init_letsencrypt()


  File "/scripts/bootstrap.py", line 32, in init_letsencrypt


    wait_for_nginx()


  File "/scripts/utils/__init__.py", line 288, in wait_for_nginx


    if ':80 ' in output:


TypeError: a bytes-like object is required, not 'str'


*** /scripts/start.py exited with status 1.


*** Shutting down runit daemon (PID 23)...


*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...


*** Killing all processes...


*** Running /etc/my_init.d/01_create_data_links.sh...


rm: cannot remove '/var/log/nginx': Device or resource busy


*** Booting runit daemon...


*** Runit started as PID 23


*** Running /scripts/start.py...


[2020-04-25 12:35:43] Preparing for letsencrypt ...


Traceback (most recent call last):


  File "/scripts/start.py", line 86, in <module>


    main()


  File "/scripts/start.py", line 51, in main


    init_letsencrypt()


  File "/scripts/bootstrap.py", line 32, in init_letsencrypt


    wait_for_nginx()


  File "/scripts/utils/__init__.py", line 288, in wait_for_nginx


    if ':80 ' in output:


TypeError: a bytes-like object is required, not 'str'


*** /scripts/start.py exited with status 1.


*** Shutting down runit daemon (PID 23)...


*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...


*** Killing all processes...


*** Running /etc/my_init.d/01_create_data_links.sh...


rm: cannot remove '/var/log/nginx': Device or resource busy


*** Booting runit daemon...


*** Runit started as PID 23


*** Running /scripts/start.py...


[2020-04-25 12:36:45] Preparing for letsencrypt ...


Traceback (most recent call last):


  File "/scripts/start.py", line 86, in <module>


    main()


  File "/scripts/start.py", line 51, in main


    init_letsencrypt()


  File "/scripts/bootstrap.py", line 32, in init_letsencrypt


    wait_for_nginx()


  File "/scripts/utils/__init__.py", line 288, in wait_for_nginx


    if ':80 ' in output:


TypeError: a bytes-like object is required, not 'str'


*** /scripts/start.py exited with status 1.


*** Shutting down runit daemon (PID 23)...


*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...


*** Killing all processes...


*** Running /etc/my_init.d/01_create_data_links.sh...


rm: cannot remove '/var/log/nginx': Device or resource busy


*** Booting runit daemon...


*** Runit started as PID 23


*** Running /scripts/start.py...


[2020-04-25 12:37:48] Preparing for letsencrypt ...


Traceback (most recent call last):


  File "/scripts/start.py", line 86, in <module>


    main()


  File "/scripts/start.py", line 51, in main


    init_letsencrypt()


  File "/scripts/bootstrap.py", line 32, in init_letsencrypt


    wait_for_nginx()


  File "/scripts/utils/__init__.py", line 288, in wait_for_nginx


    if ':80 ' in output:


TypeError: a bytes-like object is required, not 'str'


*** /scripts/start.py exited with status 1.


*** Shutting down runit daemon (PID 23)...


*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...


*** Killing all processes...


*** Running /etc/my_init.d/01_create_data_links.sh...


rm: cannot remove '/var/log/nginx': Device or resource busy


*** Booting runit daemon...


*** Runit started as PID 24


*** Running /scripts/start.py...


[2020-04-25 12:38:50] Preparing for letsencrypt ...


Traceback (most recent call last):


  File "/scripts/start.py", line 86, in <module>


    main()


  File "/scripts/start.py", line 51, in main


    init_letsencrypt()


  File "/scripts/bootstrap.py", line 32, in init_letsencrypt


    wait_for_nginx()


  File "/scripts/utils/__init__.py", line 288, in wait_for_nginx


    if ':80 ' in output:


TypeError: a bytes-like object is required, not 'str'


*** /scripts/start.py exited with status 1.


*** Shutting down runit daemon (PID 24)...


*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...


*** Killing all processes...

I´ve lived with this error since the upgrade from 6 to version 7. The cause is that the letsencrypt certificate is not getting renewed automatically. Therefore i strongly believe that there is an error in the “stack” thats responsible for the renewing/autorestarting.

and the docker settings are set accordingly for letsenrypt:

DB_HOST db
DB_ROOT_PASSWD password
TZ Europe/Vienna
SEAFILE_SERVER_LETSENCRYPT true
SEAFILE_SERVER_HOSTNAME domainnameexternal
SEAFILE_ADMIN_EMAIL xxx@gmail.com
SEAFILE_ADMIN_PASSWORD xxxx
VIRTUAL_HOST domainnameexternal
LETSENCRYPT_HOST domainnameexternal
LETSENCRYPT_EMAIL xxx@gmail.com
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DEBIAN_FRONTEND teletype
LANG en_US.UTF-8
LANGUAGE en_US:en
LC_ALL en_US.UTF-8
SEAFILE_VERSION 7.1.3
SEAFILE_SERVER seafile-pro-server

I had to revert to 7.0.13

Would be great if that could be fixed!

thanks in advance!!

I get the same error after updating docker to 7.1.3 in the case of https with letsencrypt. If I disable https, then seafile works fine.

Same for me. Is there a temporary solution? Maybe to have certificates manually generated or updating the docker-compose.yml file?

Is there already a solution? I guess that needs to be fixed within the next versions!

is there a solution?

Did you find a solution? has this been fixed with one of the newer releases?

Hi, yes I got mine working, but I dont 100% remember how.

I think the key was to make sure your hostname was resolved on any internet DNS and pointed to your server IP. So for example, if your server name is seafile.satheras.com any DNS shall resolve this hostname and the IP shall point to your server.

When that happens, Letsencrypt central servers are able to verify your server by testing connection to it and then the script succeeds to issue you a certificate.

Try that and let us know.

Hi again,

Thanks for your fast response! I checked on that with severals dns worldwide checker tools. Everything regarding your hint was already a given. That means it can be resolved. Also port 80 and 443 are working as they should - especially for letsencrypt. So i gave the seafile-latest a try again and got the same error pattern again.

By stepping back to the old seafile-pro-mc:7.0.13 seafile docker release it works as a workaround. Only with the step up to the newest version those errors are showing up and preventing from booting up seafile. Therefore i am clueless again :frowning:

Hmm, can you try to run with
docker-compose up
without -d and see the logs on the screen to understand where it fails?

I have same issu with bytes-like object is required, not ‘str’

Could you please check my logs. I have no any ideas

docker-compose up

Removing seafile
seafile-memcached is up-to-date
seafile-mysql is up-to-date
Recreating f12edea1cc5a_seafile …

ERROR: for f12edea1cc5a_seafile a bytes-like object is required, not ‘str’

ERROR: for seafile a bytes-like object is required, not ‘str’
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/docker/api/client.py”, line 261, in _raise_for_status
response.raise_for_status()
File “/usr/lib/python3/dist-packages/requests/models.py”, line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.22/containers/ee4c57f9c99361aeb95840fba88f35c6a4e57cdbb04a042db8d076776baa663e/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/compose/service.py”, line 625, in start_container
container.start()
File “/usr/lib/python3/dist-packages/compose/container.py”, line 241, in start
return self.client.start(self.id, **options)
File “/usr/lib/python3/dist-packages/docker/utils/decorators.py”, line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File “/usr/lib/python3/dist-packages/docker/api/container.py”, line 1095, in start
self._raise_for_status(res)
File “/usr/lib/python3/dist-packages/docker/api/client.py”, line 263, in _raise_for_status
raise create_api_error_from_http_exception(e)
File “/usr/lib/python3/dist-packages/docker/errors.py”, line 31, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error (“b’driver failed programming external connectivity on endpoint seafile (adafaba3a31835096df1802ae9629a80e4c72158f55d89c61f3f8f5d5b21d4fa): Bind for 0.0.0.0:443 failed: port is already allocated’”)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/bin/docker-compose”, line 11, in
load_entry_point(‘docker-compose==1.25.0’, ‘console_scripts’, ‘docker-compose’)()
File “/usr/lib/python3/dist-packages/compose/cli/main.py”, line 72, in main
command()
File “/usr/lib/python3/dist-packages/compose/cli/main.py”, line 128, in perform_command
handler(command, command_options)
File “/usr/lib/python3/dist-packages/compose/cli/main.py”, line 1107, in up
to_attach = up(False)
File “/usr/lib/python3/dist-packages/compose/cli/main.py”, line 1088, in up
return self.project.up(
File “/usr/lib/python3/dist-packages/compose/project.py”, line 565, in up
results, errors = parallel.parallel_execute(
File “/usr/lib/python3/dist-packages/compose/parallel.py”, line 112, in parallel_execute
raise error_to_reraise
File “/usr/lib/python3/dist-packages/compose/parallel.py”, line 210, in producer
result = func(obj)
File “/usr/lib/python3/dist-packages/compose/project.py”, line 548, in do
return service.execute_convergence_plan(
File “/usr/lib/python3/dist-packages/compose/service.py”, line 561, in execute_convergence_plan
return self._execute_convergence_recreate(
File “/usr/lib/python3/dist-packages/compose/service.py”, line 486, in _execute_convergence_recreate
containers, errors = parallel_execute(
File “/usr/lib/python3/dist-packages/compose/parallel.py”, line 112, in parallel_execute
raise error_to_reraise
File “/usr/lib/python3/dist-packages/compose/parallel.py”, line 210, in producer
result = func(obj)
File “/usr/lib/python3/dist-packages/compose/service.py”, line 481, in recreate
return self.recreate_container(
File “/usr/lib/python3/dist-packages/compose/service.py”, line 602, in recreate_container
self.start_container(new_container)
File “/usr/lib/python3/dist-packages/compose/service.py”, line 627, in start_container
if “driver failed programming external connectivity” in ex.explanation:
TypeError: a bytes-like object is required, not ‘str’