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

ebook-convert : Error: unsupported locale setting #34

Closed
Ribero opened this issue Aug 26, 2018 · 10 comments
Closed

ebook-convert : Error: unsupported locale setting #34

Ribero opened this issue Aug 26, 2018 · 10 comments
Assignees
Labels

Comments

@Ribero
Copy link

Ribero commented Aug 26, 2018

Hi,

I just upgraded to the latest version of the docker image (v1.2.1 running on Docker on a Synology NAS 6.2). I setup calibre-web to use ebook-ceonvert (instead of kindlegen) with the recommended path (/opt/calibre/ebook-convert). I'm encountering issues when trying to use the "send to kindle" :

failed

I also tried:

bash-4.4# echo $LANG $LC_ALL $LANGUAGE $CONTAINER_TIMEZONE $SET_CONTAINER_TIMEZONE ;
fr_FR.UTF-8 fr_FR.UTF-8 fr_FR:fr Europe/Paris true                                                                                                           

bash-4.4# /opt/calibre/ebook-convert                                              
WARNING: Failed to set default libc locale, using en_US.UTF-8                                                                                                
Traceback (most recent call last):                                                                                                                           
  File "site.py", line 72, in main                                                                                                                           
  File "site.py", line 18, in set_default_encoding                                                                                                           
  File "locale.py", line 581, in setlocale
Error: unsupported locale setting                                                                                                           

Here is my current setup :

Calibre-Web (OzzieIsaacs) : Current commit timestamp: 22/08/2018 21:55

linked_libraries

@Technosoft2000 Technosoft2000 self-assigned this Aug 27, 2018
@Technosoft2000
Copy link
Owner

Hi @Ribero

glibc package comes with the following available locale definitions by default - checked with the following command:

bash-4.4# /usr/glibc-compat/bin/locale -a
C
C.utf8
POSIX
bash-4.4# 

I've found the following post gliderlabs/docker-alpine#144 and I'll try to include the suggested solution to get it work for other languages too.

@Ribero
Copy link
Author

Ribero commented Aug 27, 2018

on my setup:

bash-4.4# /usr/glibc-compat/bin/locale -a                                                                                            
/usr/glibc-compat/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory                                       
/usr/glibc-compat/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory                                    
/usr/glibc-compat/bin/locale: Cannot set LC_COLLATE to default locale: No such file or directory                                     
C                                                                                                                                    
C.utf8                                                                                                                               
POSIX

Technosoft2000 added a commit that referenced this issue Aug 28, 2018
…ilaible locale](LOCALE.md).

 - fixed issue **ebook-convert : Error: unsupported locale setting** #34
 - updated README.md with new sections: Configuration of a converter, Known issues, Container Locale
 - updated libraries
@Technosoft2000
Copy link
Owner

@Ribero

please try now my latest from today v1.2.2 and let me know the result :)

@Ribero
Copy link
Author

Ribero commented Aug 28, 2018

:) it works like a charm thanks a lot:

bash-4.4# /opt/calibre/ebook-convert /books/Duff\,Hilary/Elixir\ \(1206\)/Elixir\ -\ Duff\,Hilary.epub ./test.mobi                   
1% Conversion de l’entrée en HTML…                                                                                                   
InputFormatPlugin: EPUB Input running                                                                                                
on /books/Duff,Hilary/Elixir (1206)/Elixir - Duff,Hilary.epub                                                                        
Found HTML cover titlepage.xhtml                                                                                                     
Parsing all content...                                                                                                               
34% Exécution des transformations du livre numérique…                                                                                
Merging user specified metadata...                                                                                                   
Detecting structure...                                                                                                               
Flattening CSS and remapping font sizes...                                                                                           
Source base font size is 15.99996pt                                                                                                  
Removing fake margins...                                                                                                             
Cleaning up manifest...                                                                                                              
Trimming unused files from manifest...                                                                                               
Trimming u'titlepage.xhtml' from manifest                                                                                            
Creating MOBI Output...                                                                                                              
67% Exécution de l'extension MOBI Output                                                                                             
Serializing resources...                                                                                                             
Creating MOBI 6 output                                                                                                               
Generating in-line TOC...                                                                                                            
Applying case-transforming CSS...                                                                                                    
Rasterizing SVG images...                                                                                                            
Converting XHTML to Mobipocket markup...                                                                                             
Serializing markup content...                                                                                                        
  Compressing markup content...                                                                                                      
Generating MOBI index for a book                                                                                                     
MOBI output written to /calibre-web/app/test.mobi                                                                                    
Sortie sauvegardée vers   /calibre-web/app/test.mobi    

Note: user calibre does not have a home dir. It generates an error when running ebook-convert that wants to write to /home/calibre/.config/calibre...

Manually creating the home dir solves the problem.

And for those wondering:

bash-4.4# /usr/glibc-compat/bin/locale -a                                                                                            
aa_DJ.utf8                                                                                                                           
aa_ER.utf8                                                                                                                           
aa_ET.utf8                                                                                                                           
af_ZA.utf8                                                                                                                           
am_ET.utf8                                                                                                                           
an_ES.utf8                                                                                                                           
ar_AE.utf8                                                                                                                           
ar_BH.utf8                                                                                                                           
ar_DZ.utf8                                                                                                                           
ar_EG.utf8                                                                                                                           
ar_IN.utf8                                                                                                                           
ar_IQ.utf8                                                                                                                           
ar_JO.utf8                                                                                                                           
ar_KW.utf8                                                                                                                           
ar_LB.utf8                                                                                                                           
ar_LY.utf8                                                                                                                           
ar_MA.utf8                                                                                                                           
ar_OM.utf8                                                                                                                           
ar_QA.utf8                                                                                                                           
ar_SA.utf8                                                                                                                           
ar_SD.utf8                                                                                                                           
ar_SY.utf8                                                                                                                           
ar_TN.utf8                                                                                                                           
ar_YE.utf8                                                                                                                           
as_IN.utf8                                                                                                                           
ast_ES.utf8                                                                                                                          
ayc_PE.utf8                                                                                                                          
az_AZ.utf8                                                                                                                           
be_BY.utf8                                                                                                                           
bem_ZM.utf8                                                                                                                          
ber_DZ.utf8                                                                                                                          
ber_MA.utf8                                                                                                                          
bg_BG.utf8                                                                                                                           
bho_IN.utf8                                                                                                                          
bn_BD.utf8                                                                                                                           
bn_IN.utf8                                                                                                                           
bo_CN.utf8                                                                                                                           
bo_IN.utf8                                                                                                                           
br_FR.utf8                                                                                                                           
brx_IN.utf8                                                                                                                          
bs_BA.utf8                                                                                                                           
byn_ER.utf8                                                                                                                          
C                                                                                                                                    
ca_AD.utf8                                                                                                                           
ca_ES.utf8                                                                                                                           
ca_FR.utf8                                                                                                                           
ca_IT.utf8                                                                                                                           
crh_UA.utf8                                                                                                                          
csb_PL.utf8                                                                                                                          
cs_CZ.utf8
cv_RU.utf8                                                                                                                           
cy_GB.utf8                                                                                                                           
da_DK.utf8                                                                                                                           
de_AT.utf8                                                                                                                           
de_BE.utf8                                                                                                                           
de_CH.utf8                                                                                                                           
de_DE.utf8                                                                                                                           
de_LU.utf8                                                                                                                           
doi_IN.utf8                                                                                                                          
dv_MV.utf8                                                                                                                           
dz_BT.utf8                                                                                                                           
el_CY.utf8                                                                                                                           
el_GR.utf8                                                                                                                           
en_AG.utf8                                                                                                                           
en_AU.utf8                                                                                                                           
en_BW.utf8                                                                                                                           
en_CA.utf8                                                                                                                           
en_DK.utf8                                                                                                                           
en_GB.utf8                                                                                                                           
en_HK.utf8                                                                                                                           
en_IE.utf8                                                                                                                           
en_IN.utf8                                                                                                                           
en_NG.utf8                                                                                                                           
en_NZ.utf8                                                                                                                           
en_PH.utf8                                                                                                                           
en_SG.utf8                                                                                                                           
en_US.utf8                                                                                                                           
en_ZA.utf8                                                                                                                           
en_ZM.utf8                                                                                                                           
en_ZW.utf8                                                                                                                           
es_AR.utf8                                                                                                                           
es_BO.utf8                                                                                                                           
es_CL.utf8                                                                                                                           
es_CO.utf8                                                                                                                           
es_CR.utf8                                                                                                                           
es_CU.utf8                                                                                                                           
es_DO.utf8                                                                                                                           
es_EC.utf8                                                                                                                           
es_ES.utf8                                                                                                                           
es_GT.utf8                                                                                                                           
es_HN.utf8                                                                                                                           
es_MX.utf8                                                                                                                           
es_NI.utf8                                                                                                                           
es_PA.utf8                                                                                                                           
es_PE.utf8
es_PR.utf8                                                                                                                           
es_PY.utf8                                                                                                                           
es_SV.utf8                                                                                                                           
es_US.utf8                                                                                                                           
es_UY.utf8                                                                                                                           
es_VE.utf8                                                                                                                           
et_EE.utf8                                                                                                                           
eu_ES.utf8                                                                                                                           
fa_IR.utf8                                                                                                                           
ff_SN.utf8                                                                                                                           
fi_FI.utf8                                                                                                                           
fil_PH.utf8                                                                                                                          
fo_FO.utf8                                                                                                                           
fr_BE.utf8                                                                                                                           
fr_CA.utf8                                                                                                                           
fr_CH.utf8                                                                                                                           
fr_FR.utf8                                                                                                                           
fr_LU.utf8                                                                                                                           
fur_IT.utf8                                                                                                                          
fy_DE.utf8                                                                                                                           
fy_NL.utf8                                                                                                                           
ga_IE.utf8                                                                                                                           
gd_GB.utf8                                                                                                                           
gez_ER.utf8                                                                                                                          
gez_ET.utf8                                                                                                                          
gl_ES.utf8                                                                                                                           
gu_IN.utf8                                                                                                                           
gv_GB.utf8                                                                                                                           
ha_NG.utf8                                                                                                                           
he_IL.utf8                                                                                                                           
hi_IN.utf8                                                                                                                           
hne_IN.utf8                                                                                                                          
hr_HR.utf8                                                                                                                           
hsb_DE.utf8                                                                                                                          
ht_HT.utf8                                                                                                                           
hu_HU.utf8                                                                                                                           
hy_AM.utf8                                                                                                                           
ia_FR.utf8                                                                                                                           
id_ID.utf8                                                                                                                           
ig_NG.utf8                                                                                                                           
ik_CA.utf8                                                                                                                           
is_IS.utf8                                                                                                                           
it_CH.utf8                                                                                                                           
it_IT.utf8                                                                                                                           
iu_CA.utf8  
ja_JP.utf8                                                                                                                           
ka_GE.utf8                                                                                                                           
kk_KZ.utf8                                                                                                                           
kl_GL.utf8                                                                                                                           
km_KH.utf8                                                                                                                           
kn_IN.utf8                                                                                                                           
kok_IN.utf8                                                                                                                          
ko_KR.utf8                                                                                                                           
ks_IN.utf8                                                                                                                           
ku_TR.utf8                                                                                                                           
kw_GB.utf8                                                                                                                           
ky_KG.utf8                                                                                                                           
lb_LU.utf8                                                                                                                           
lg_UG.utf8                                                                                                                           
li_BE.utf8                                                                                                                           
lij_IT.utf8                                                                                                                          
li_NL.utf8                                                                                                                           
lo_LA.utf8                                                                                                                           
lt_LT.utf8                                                                                                                           
lv_LV.utf8                                                                                                                           
mag_IN.utf8                                                                                                                          
mai_IN.utf8                                                                                                                          
mg_MG.utf8                                                                                                                           
mhr_RU.utf8                                                                                                                          
mi_NZ.utf8                                                                                                                           
mk_MK.utf8                                                                                                                           
ml_IN.utf8                                                                                                                           
mni_IN.utf8                                                                                                                          
mn_MN.utf8                                                                                                                           
mr_IN.utf8                                                                                                                           
ms_MY.utf8                                                                                                                           
mt_MT.utf8                                                                                                                           
my_MM.utf8                                                                                                                           
nb_NO.utf8                                                                                                                           
nds_DE.utf8                                                                                                                          
nds_NL.utf8                                                                                                                          
ne_NP.utf8                                                                                                                           
nhn_MX.utf8                                                                                                                          
niu_NU.utf8                                                                                                                          
niu_NZ.utf8                                                                                                                          
nl_AW.utf8                                                                                                                           
nl_BE.utf8                                                                                                                           
nl_NL.utf8                                                                                                                           
nn_NO.utf8                                                                                                                           
nr_ZA.utf8                                                                                                                           
nso_ZA.utf8                                                                                                                          
oc_FR.utf8                                                                                                                           
om_ET.utf8                                                                                                                           
om_KE.utf8                                                                                                                           
or_IN.utf8    
os_RU.utf8                                                                                                                           
pa_IN.utf8                                                                                                                           
pa_PK.utf8                                                                                                                           
pl_PL.utf8                                                                                                                           
POSIX                                                                                                                                
ps_AF.utf8                                                                                                                           
pt_BR.utf8                                                                                                                           
pt_PT.utf8                                                                                                                           
ro_RO.utf8                                                                                                                           
ru_RU.utf8                                                                                                                           
ru_UA.utf8                                                                                                                           
rw_RW.utf8                                                                                                                           
sa_IN.utf8                                                                                                                           
sat_IN.utf8                                                                                                                          
sc_IT.utf8                                                                                                                           
sd_IN.utf8                                                                                                                           
se_NO.utf8                                                                                                                           
shs_CA.utf8                                                                                                                          
sid_ET.utf8                                                                                                                          
si_LK.utf8                                                                                                                           
sk_SK.utf8                                                                                                                           
sl_SI.utf8                                                                                                                           
so_DJ.utf8                                                                                                                           
so_ET.utf8                                                                                                                           
so_KE.utf8                                                                                                                           
so_SO.utf8                                                                                                                           
sq_AL.utf8                                                                                                                           
sq_MK.utf8                                                                                                                           
sr_ME.utf8                                                                                                                           
sr_RS.utf8                                                                                                                           
ss_ZA.utf8                                                                                                                           
st_ZA.utf8                                                                                                                           
sv_FI.utf8                                                                                                                           
sv_SE.utf8                                                                                                                           
sw_KE.utf8                                                                                                                           
sw_TZ.utf8                                                                                                                           
szl_PL.utf8                                                                                                                          
ta_IN.utf8                                                                                                                           
ta_LK.utf8                                                                                                                           
te_IN.utf8                                                                                                                           
tg_TJ.utf8                                                                                                                           
th_TH.utf8                                                                                                                           
ti_ER.utf8                                                                                                                           
ti_ET.utf8                                                                                                                           
tig_ER.utf8                                                                                                                          
tk_TM.utf8                                                                                                                           
tl_PH.utf8                                                                                                                           
tn_ZA.utf8                                                                                                                           
tr_CY.utf8                                                                                                                           
tr_TR.utf8      
ts_ZA.utf8                                                                                                                           
tt_RU.utf8                                                                                                                           
ug_CN.utf8                                                                                                                           
uk_UA.utf8                                                                                                                           
unm_US.utf8                                                                                                                          
ur_IN.utf8                                                                                                                           
ur_PK.utf8                                                                                                                           
uz_UZ.utf8                                                                                                                           
ve_ZA.utf8                                                                                                                           
vi_VN.utf8                                                                                                                           
wa_BE.utf8                                                                                                                           
wae_CH.utf8                                                                                                                          
wal_ET.utf8                                                                                                                          
wo_SN.utf8                                                                                                                           
xh_ZA.utf8                                                                                                                           
yi_US.utf8                                                                                                                           
yo_NG.utf8                                                                                                                           
yue_HK.utf8                                                                                                                          
zh_CN.utf8                                                                                                                           
zh_HK.utf8                                                                                                                           
zh_SG.utf8                                                                                                                           
zh_TW.utf8                                                                                                                           
zu_ZA.utf8         

@Ribero
Copy link
Author

Ribero commented Aug 28, 2018

It works from the CLI but not from the GUI:

Process stuck at 67%, mobi file not created (or, at least, not created at the destination path)

capture d ecran 2018-08-28 a 19 50 12

logs:

2018-08-28 17:45:43,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:43] "GET /ajax/emailstat HTTP/1.1" 200 444 0.021596
2018-08-28 17:45:42,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:42] "GET /ajax/emailstat HTTP/1.1" 200 442 0.071143
2018-08-28 17:45:41,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:41] "GET /ajax/emailstat HTTP/1.1" 200 442 0.032011
2018-08-28 17:45:38,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:38] "GET /tasks HTTP/1.1" 200 11118 0.269264
2018-08-28 17:45:38,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:38] "GET /ajax/emailstat HTTP/1.1" 200 442 0.024532
2018-08-28 17:45:38,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:38] "GET /ajax/emailstat?sort=id&order=asc HTTP/1.1" 200 442 0.026077
2018-08-28 17:45:36,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:36] "GET /cover/Duff%2CHilary/Elixir%20%281206%29 HTTP/1.1" 200 77937 0.194106
2018-08-28 17:45:35,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:35] "GET /book/1206 HTTP/1.1" 200 14095 3.170690
2018-08-28 17:45:32,stdout,::ffff:172.17.0.1 - - [2018-08-28 19:45:32] "GET /send/1206 HTTP/1.1" 302 723 0.395332

I need to do some more deeper test to get more clues about why it does not work from the GUI...

@Technosoft2000
Copy link
Owner

Interessting, because I've successfully converted and sent an epub via GUI yesterday.
Could you please change the logging level of Calibre-Web from INFO to DEBUG and test again, then look at the calibre-web.log file via docker exec -it calibre-web tail -f /calibre-web/app/calibre-web.log

@Ribero
Copy link
Author

Ribero commented Aug 29, 2018

[2018-08-29 21:01:15,233] DEBUG in worker: 1% Conversion de l’entrée en HTML…                                                                                                          
[2018-08-29 21:01:15,795] DEBUG in worker: InputFormatPlugin: EPUB Input running                                                                                                       
[2018-08-29 21:01:15,800] DEBUG in worker: on /books/Duff,Hilary/Elixir (1206)/Elixir - Duff,Hilary.epub                                                                               
[2018-08-29 21:01:20,344] DEBUG in worker: Found HTML cover titlepage.xhtml                                                                                                            
[2018-08-29 21:01:20,494] DEBUG in worker: Parsing all content...                                                                                                                      
[2018-08-29 21:01:24,462] DEBUG in worker: 34% Exécution des transformations du livre numérique…                                                                                       
[2018-08-29 21:01:25,087] DEBUG in worker: Merging user specified metadata...                                                                                                          
[2018-08-29 21:01:25,163] DEBUG in worker: Detecting structure...                                                                                                                      
[2018-08-29 21:01:28,121] DEBUG in worker: Flattening CSS and remapping font sizes...                                                                                                  
[2018-08-29 21:01:39,382] DEBUG in worker: Source base font size is 15.99996pt                                                                                                         
[2018-08-29 21:01:46,127] DEBUG in worker: Removing fake margins...                                                                                                                    
[2018-08-29 21:01:56,234] DEBUG in worker: Cleaning up manifest...                                                                                                                     
[2018-08-29 21:01:56,285] DEBUG in worker: Trimming unused files from manifest...                                                                                                      
[2018-08-29 21:01:56,572] DEBUG in worker: Trimming u'titlepage.xhtml' from manifest                                                                                                   
[2018-08-29 21:01:56,616] DEBUG in worker: Creating MOBI Output...                                                                                                                     
[2018-08-29 21:01:56,622] DEBUG in worker: 67% Exécution de l'extension MOBI Output     

it stay stuck at (translated) :

67% Execute MOBI output extension

No other message until I restart the server

@Technosoft2000
Copy link
Owner

Could please check your Converter configuration at Calibe-Web GUI that there is the path /opt/calibre/ebook-convert and not /opt/calibre/bin/ebook-convert

@Ribero
Copy link
Author

Ribero commented Aug 29, 2018

Gotcha !

changing /opt/calibre/bin/ebook-convert by /opt/calibre/ebook-convert solved the issue.

Thanks a lot !

PS : It's probably a good idea to update the [README.md] (https://github.com/Technosoft2000/docker-calibre-web/blob/master/README.md) to reflect the change

@Technosoft2000
Copy link
Owner

OMG :-o thanks for the hint regarding the README.md this was really a mistake; I'll correct this immediately :)

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

No branches or pull requests

2 participants