Cannot login using iOS app

Hi All,

I’m not able to login to my Seafile server using the iOS app. I get the following error when I try to log in using the app:

Failed to login: Request failed: internal server error (500)

However, I have no problems logging in using the web browser, and no problems using the macOS client.

Digging in the logs I see the following message in seahub.log which might be related:

2021-11-23 13:46:52,640 [ERROR] django.request:222 log_response Internal Server Error: /api2/auth-token/
Traceback (most recent call last):
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/opt/seafile/seafile-server-8.0.7/seahub/thirdpart/django/db/backends/mysql/base.py", line 71, in execute
    return self.cursor.execute(query, args)
  File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 206, in execute
    res = self._query(query)
  File "/usr/local/lib/python3.8/dist-packages/MySQLdb/cursors.py", line 319, in _query
    db.query(q)
  File "/usr/local/lib/python3.8/dist-packages/MySQLdb/connections.py", line 259, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xB112...' for column `seahub_db`.`api2_tokenv2`.`device_name` at row 1")

I’m using docker, here’s my docker-compose.yaml which is exactly as recommended (I think):

version: '2'
services:
  db:
    image: mariadb:10.5
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=redacted
      - MYSQL_LOG_CONSOLE=true
    restart: unless-stopped
    volumes:
      - /home/tucknology/data/seafile/mysql:/var/lib/mysql
    networks:
      - seafile-net

  memcached:
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net

  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    restart: unless-stopped
    ports:
      - "8000:80"
    volumes:
      - /home/tucknology/data/seafile/shared:/shared   
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=redacted
      - TIME_ZONE=America/Los_Angeles
      - SEAFILE_ADMIN_EMAIL=redacted@redacted.com
      - SEAFILE_ADMIN_PASSWORD=redacted
      - SEAFILE_SERVER_LETSENCRYPT=false
      - SEAFILE_SERVER_HOSTNAME=seafile.redacted.com
    depends_on:
      - db
      - memcached
    networks:
      - seafile-net

networks:
  seafile-net:

I’m using the Nginx Proxy Manager in docker to manage reverse proxy as well as letsencrypt for SSL. I have this working for several other hosted services.

Any ideas would be most appreciated!

You iOS client has a special character in the device name that cause the problem. You can use simple characters as the device name or update to Seafile 9.0

1 Like

Hi @daniel.pan thank you so much for identifying the issue.

I tried Seafile 9.0.1 also and it had the same issue. Obviously I can change the name of my iOS device as a workaround. Would it be helpful if I filed an issue on the iOS client github?

This is a server side problem. You can add the following option to solve the problem.

2 Likes