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

character '\u200d' is not removed from end of email address and causes an error on send emails #2432

Closed
filwu8 opened this issue Jun 5, 2022 · 13 comments

Comments

@filwu8
Copy link

filwu8 commented Jun 5, 2022

Describe the bug/problem
Error sending email

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'setup smtp'
  2. Click on 'save'
  3. Scroll down to 'tasks'
  4. See error

Logfile

[2022-06-05 11:01:03,992] ERROR {cps.isoLanguages:59} Missing translation for language name:
[2022-06-05 11:01:03,992] ERROR {cps.isoLanguages:59} Missing translation for language name:
[2022-06-05 11:01:48,001] INFO {cps.ub:855} Book 32746 readbit toggled
[2022-06-05 11:14:31,650] INFO {cps.web:1384} Serving book: Docker技术入门与实战第2版 - 未知
[2022-06-05 11:34:15,197] WARN {cps.converter:44} /books: [Errno 13] Permission denied: '/books'
[2022-06-05 11:36:09,197] INFO {cps.web:1384} Serving book: Yi Liu Feng Kuang _Jing Ying De - Wei Zhi
[2022-06-05 12:45:34,157] INFO {cps.web:1384} Serving book: Docker技术入门与实战第2版 - 未知
[2022-06-05 12:57:15,723] ERROR {cps.tasks.mail:178} 'ascii' codec can't encode character '\u200d' in position 13: ordinal not in range(128)

Expected behavior

how to sent email

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

 - OS: Win11 + Docerk Desktop + linuxserver/calibre-web
Platform | Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64
Python | 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
Calibre_Web | 0.6.18 - fee76741a02899d2dfdc2ce29cfc27901a06383c - 2022-04-03T20:17:34+02:00
Werkzeug | 2.0.3
Jinja2 | 3.1.2
pySqlite | 2.6.0
SQLite | 3.31.1
werkzeug | 2.0.3
Babel | 2.10.1
Flask-Babel | 2.0.0
Flask-Login | 0.5.0
Flask-Principal | 0.4.0
backports_abc | 0.5
Flask | 2.0.3
iso-639 | 0.4.5
PyPDF3 | 1.0.6
pytz | 2022.1
requests | 2.27.1
SQLAlchemy | 1.4.36
tornado | 6.1
Wand | 0.6.7
unidecode | 1.3.4
lxml | 4.8.0
flask-wtf | 1.0.1
chardet | 4.0.0
advocate | 1.0.0
google-api-python-client | 2.42.0
gevent | 21.12.0
greenlet | 1.1.2
httplib2 | 0.20.4
oauth2client | 4.1.3
uritemplate | 4.1.1
pyasn1-modules | 0.2.8
pyasn1 | 0.4.8
PyDrive2 | 1.10.1
PyYAML | 6.0
rsa | 4.8
google-auth-oauthlib | 0.5.1
goodreads | 0.3.2
python-Levenshtein | 0.12.2
python-ldap | 3.4.0
Flask-SimpleLDAP | 1.4.0
Flask-Dance | 5.1.0
SQLAlchemy-Utils | 0.38.2
rarfile | 4.0
scholarly | 1.6.3
markdown2 | 2.4.3
html2text | 2020.1.16
python-dateutil | 2.8.2
beautifulsoup4 | 4.10.0
cchardet | 2.1.7
natsort | 8.1.0
comicapi | 2.2.1
jsonschema | 4.4.0
Image Magick | ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
ebook converter | ebook-convert (calibre 5.43.0)
unrar | UNRAR 5.61 beta 1 freeware Copyright (c) 1993-2018 Alexander Roshal
kepubify | 缺少执行权限

Additional context

access via reverse proxy

@OzzieIsaacs
Copy link
Collaborator

I'm sorry, the description is still to vague. For me and many other people this is working.
Please tell me what exactly you did. And/or try to change something to make the issue disappear.
From your description you are having a newly installed calibre-web, nothing changed from standard settings and just configured the mail settings and than the error occurs. In this case is would not make any difference if you click on task as first step, because there are no tasks listed in both cases. Did you really click on save or on save and send test mail? Did you change th UI language to something else than english, what happens if you use english?
Did you convert a book, send a book via email, uploaded a book? What is really causing the problem?

@filwu8
Copy link
Author

filwu8 commented Jun 5, 2022

change th UI language to english, look like :

3021654408366_ pic

3031654408394_ pic

I did not convert a book, did not send a book via email, did not uploaded a book

this‘s is my compose

version: "2.1"
services:
calibre-web:
image: linuxserver/calibre-web:latest
container_name: calibre-web
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Shanghai #https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- DOCKER_MODS=linuxserver/calibre-web:calibre #optional
- OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional
volumes:
- ./config:/config
- ./books:/books
ports:
- 8083:8083
restart: unless-stopped

@OzzieIsaacs
Copy link
Collaborator

I changed the language to:
grafik.
Changed the email settings to what you gave me:
grafik
Pressed save and sent test email:
I get the message: 发送给a5@b.com的测试邮件已进入队列。请检查任务结果
I go to tasks:
grafik
Working perfect.
The logbooks is showing the following:
grafik
(The last errormessage is because I don't have a account and the server address isn't matching.

I did not convert a book

The logbooks tells me a different story:
At 11:14 you read a book, at 11:34 you tried to convert a book, and afterwards you read 2 other books and then you had the error.
Pleas set the loglevel to debug (as requested in the original form). And try to reproduce the error, and please be as precise as possible (I doubt please try it twice or more often (with known start conditions -> restart calibre-web between each try).

The error itself has something to do with character encoding meaning some non-ascii characters (most likely CKJ-character at place where it can't be handled.)
I did some tries with such characters but I still can't reproduce it, so I need your help

@filwu8
Copy link
Author

filwu8 commented Jun 5, 2022

When I recreate a brand new container, the error reappears

@OzzieIsaacs
Copy link
Collaborator

I need details

@filwu8
Copy link
Author

filwu8 commented Jun 5, 2022

this is new container logs

[2022-06-05 14:10:21,908] WARN {cps.config_sql:318} Log path None not valid, falling back to default
[2022-06-05 14:10:22,073] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:10:22,279] INFO {cps.ub:855} github Blueprint Created
[2022-06-05 14:10:22,291] INFO {cps.ub:855} google Blueprint Created
[2022-06-05 14:10:22,523] INFO {cps:141} Starting Calibre Web...
[2022-06-05 14:10:22,596] INFO {cps.server:205} Starting Gevent server on [::]:8083
[2022-06-05 14:10:42,512] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:10:42,520] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:11:52,699] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:11:52,706] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:14:39,770] ERROR {cps.config_sql:348} (sqlite3.DatabaseError) file is not a database
[SQL: attach database '/books/metadata.db' as calibre;]
(Background on this error at: https://sqlalche.me/e/14/4xp6)
[2022-06-05 14:14:39,770] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:14:39,777] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:14:47,099] ERROR {cps.config_sql:348} (sqlite3.DatabaseError) file is not a database
[SQL: attach database '/books/metadata.db' as calibre;]
(Background on this error at: https://sqlalche.me/e/14/4xp6)
[2022-06-05 14:14:47,099] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:14:47,106] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:15:50,242] ERROR {cps.config_sql:348} (sqlite3.DatabaseError) file is not a database
[SQL: attach database '/books/metadata.db' as calibre;]
(Background on this error at: https://sqlalche.me/e/14/4xp6)
[2022-06-05 14:15:50,242] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:15:50,250] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:15:51,845] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:15:51,852] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:24:48,443] ERROR {cps.helper:668} Invalid e-mail address format
[2022-06-05 14:25:03,934] ERROR {cps.tasks.mail:178} 'ascii' codec can't encode character '\u200d' in position 13: ordinal not in range(128)

@filwu8
Copy link
Author

filwu8 commented Jun 5, 2022

@OzzieIsaacs
Copy link
Collaborator

Sometimes I think people are doing this intentionally.

I need a COMPLETE description step by step from the first start of the program what to do to create this error with EVERY detail, if it's important like in your log above to enter 3 times a wrong metadata, okay, if not, then I don't want to know it. I asked for a log in DEBUG level. Is it important to have an invalid e-mail address format entered and if yes, tell me which email is not working. Please try to reduce the steps to as less steps as possible.
What does every detail mean:
Wrong: I logged in.
Better: I entered the direct address (no reverse proxy) of calibre-web into my Firefox browser and logged in with the default credentials: user admin, password: admin123

@filwu8
Copy link
Author

filwu8 commented Jun 5, 2022

step 1

Create yml file and
version: "2.1" services: calibre-web-test: image: linuxserver/calibre-web:latest container_name: calibre-web-test environment: - PUID=1000 - PGID=1000 - TZ=Asia/Shanghai #https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - DOCKER_MODS=linuxserver/calibre-web:calibre #optional - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional volumes: - ./config:/config - ./books:/books ports: - 8085:8083 restart: unless-stopped

step 2
docker-compose up -d

when done

3061654411258_ pic
e

step 3
open url : http://localhost:8085
login: admin admin123
3091654411755_ pic

step 4
WeChat3c097dd73db473a5f743b8bbf61f1cb3

i downloaded db from
https://denyu95.github.io/2019/09/05/%E7%BE%A4%E6%99%96%E4%B8%8ADocker%E4%B8%AD%E5%AE%89%E8%A3%85Calibre/metadata.db

and save in folder books

3101654411995_ pic

3111654412019_ pic

setup profile

3121654412089_ pic

step 5 Edit E-mail Server Settings

WeChat28605af82cb49231be188b7a56c1a5c0

3131654412262_ pic

[2022-06-05 14:47:32,880] WARN {cps.config_sql:318} Log path None not valid, falling back to default
[2022-06-05 14:47:33,046] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:47:33,278] INFO {cps.ub:855} github Blueprint Created
[2022-06-05 14:47:33,290] INFO {cps.ub:855} google Blueprint Created
[2022-06-05 14:47:35,532] INFO {cps:141} Starting Calibre Web...
[2022-06-05 14:47:35,603] INFO {cps.server:205} Starting Gevent server on [::]:8083
[2022-06-05 14:48:45,859] WARN {cps.web:1555} Login failed for user "admin" IP-address: ::ffff:172.19.0.1
[2022-06-05 14:50:07,699] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:50:07,706] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:52:01,609] WARN {cps.config_sql:349} invalidating configuration
[2022-06-05 14:52:01,616] ERROR {cps.admin:1374} DB Location is not Valid, Please Enter Correct Path
[2022-06-05 14:57:26,249] ERROR {cps.tasks.mail:178} 'ascii' codec can't encode character '\u200d' in position 13: ordinal not in range(128)

this is debug log

Calibre-Web-debug-pack.zip

@OzzieIsaacs
Copy link
Collaborator

Your email address "..@qq.com" ends with a unicode character " " (Zero Width Joiner), is this necessary? Could you please remove it

@filwu8
Copy link
Author

filwu8 commented Jun 5, 2022

The email address doesn't look like it ends with the unicode character "" (zero-width hyphen)

3141654413133_ pic

3151654413157_ pic

3161654413187_ pic

@filwu8
Copy link
Author

filwu8 commented Jun 5, 2022

thank you very much

i used keyboard input " filwu@qq.com". works fine

but i used " Ctrl + C "copy filwu@qq.com , then "Ctrl + V ", it's happend

ERROR {cps.tasks.mail:178} 'ascii' codec can't encode character '\u200d' in position 13: ordinal not in range(128) #2432

@OzzieIsaacs
Copy link
Collaborator

Yeah, I will have a look at it, this hidden character should be removed, this is a bug

@OzzieIsaacs OzzieIsaacs added the bug label Jun 5, 2022
@OzzieIsaacs OzzieIsaacs changed the title ERROR {cps.tasks.mail:178} 'ascii' codec can't encode character '\u200d' in position 13: ordinal not in range(128) character '\u200d' is not removed from end of email address and causes an error on send emails Jun 5, 2022
@OzzieIsaacs OzzieIsaacs reopened this Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants