Need dedicated support? Click here
Need dedicated support?
Click here

Default content is loading on a Docx

I have used docker version onlyoffice on my linux machine. I have configured as mentioned. I can able to create a docx but, it is not creating a blank docx instead it has some pre contents on it which is same as a welcome page.

and also, if i try to create some other file types means, it is showing error like below

“a error has occured while opening the the file. the file content corresponds to text document (docx) but has inconsistent pptx”

how can i resolve this ?

hey @yokesh!

wow, what exactly did you change and which guide did you follow to do it?

Hi @Nikolas

sudo docker run -i -t -d -p 8050:80 --restart=always -v onlyoffice_docx_volume:/var/lib/onlyoffice/documentserver-example/files -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql -e JWT_SECRET=my_jwt_secret onlyoffice/documentserver

this is the command i ran, and when i open the onlyoffice in brower with url as “localhost:8050” and also ran those example commands. Now I can able to create documents but I got warning and error as

If I change my ip from localhost to machine ip, it is working fine. This was one issue.

I downloaded python example from “ONLYOFFICE Api Documentation - Language-specific examples”, followed the Readme file in it. below is config

import os

VERSION = ‘1.5.1’

FILE_SIZE_MAX = 5242880
STORAGE_PATH = ‘/var/lib/docker/volumes/onlyoffice_docx_volume/_data/192.xxx.x.xxx/’

DOC_SERV_FILLFORMS = [".oform", “.docx”]
DOC_SERV_VIEWED = [".pdf", “.djvu”, “.xps”, “.oxps”] # file extensions that can be viewed
DOC_SERV_EDITED = [".docx", “.xlsx”, “.csv”, “.pptx”, “.txt”, “.docxf”] # file extensions that can be edited
DOC_SERV_CONVERT = [ # file extensions that can be converted
“.docm”, “.doc”, “.dotx”, “.dotm”, “.dot”, “.odt”,
“.fodt”, “.ott”, “.xlsm”, “.xlsb”, “.xls”, “.xltx”, “.xltm”,
“.xlt”, “.ods”, “.fods”, “.ots”, “.pptm”, “.ppt”,
“.ppsx”, “.ppsm”, “.pps”, “.potx”, “.potm”, “.pot”,
“.odp”, “.fodp”, “.otp”, “.rtf”, “.mht”, “.html”, “.htm”, “.xml”, “.epub”, “.fb2”
]

DOC_SERV_TIMEOUT = 120000

DOC_SERV_SITE_URL = ‘http://192.xxx.x.xxx:8050/

DOC_SERV_CONVERTER_URL = ‘ConvertService.ashx’
DOC_SERV_API_URL = ‘web-apps/apps/api/documents/api.js’
DOC_SERV_PRELOADER_URL = ‘web-apps/apps/api/documents/cache-scripts.html’
DOC_SERV_COMMAND_URL=‘coauthoring/CommandService.ashx’

EXAMPLE_DOMAIN = “http://192.xxx.x.xxx:8050

DOC_SERV_JWT_SECRET = ‘my_jwt_secret’ # the secret key for generating token
DOC_SERV_JWT_HEADER = ‘Authorization’

DOC_SERV_VERIFY_PEER = False

EXT_SPREADSHEET = [
“.xls”, “.xlsx”, “.xlsm”, “.xlsb”,
“.xlt”, “.xltx”, “.xltm”,
“.ods”, “.fods”, “.ots”, “.csv”
]

EXT_PRESENTATION = [
“.pps”, “.ppsx”, “.ppsm”,
“.ppt”, “.pptx”, “.pptm”,
“.pot”, “.potx”, “.potm”,
“.odp”, “.fodp”, “.otp”
]

EXT_DOCUMENT = [
“.doc”, “.docx”, “.docm”,
“.dot”, “.dotx”, “.dotm”,
“.odt”, “.fodt”, “.ott”, “.rtf”, “.txt”,
“.html”, “.htm”, “.mht”, “.xml”,
“.pdf”, “.djvu”, “.fb2”, “.epub”, “.xps”, “.oxps”, “.oform”
]

LANGUAGES = {
‘en’: ‘English’,
‘hy’: ‘Armenian’,
‘az’: ‘Azerbaijani’,
‘eu’: ‘Basque’,
‘be’: ‘Belarusian’,
‘bg’: ‘Bulgarian’,
‘ca’: ‘Catalan’,
‘zh’ : ‘Chinese (People’s Republic of China)’,
‘zh-TW’ : ‘Chinese (Traditional, Taiwan)’,
‘cs’: ‘Czech’,
‘da’: ‘Danish’,
‘nl’: ‘Dutch’,
‘fi’: ‘Finnish’,
‘fr’: ‘French’,
‘gl’: ‘Galego’,
‘de’: ‘German’,
‘el’: ‘Greek’,
‘hu’: ‘Hungarian’,
‘id’: ‘Indonesian’,
‘it’: ‘Italian’,
‘ja’: ‘Japanese’,
‘ko’: ‘Korean’,
‘lv’: ‘Latvian’,
‘lo’: ‘Lao’,
‘ms’: ‘Malay (Malaysia)’,
‘nb’: ‘Norwegian’,
‘pl’: ‘Polish’,
‘pt’ : ‘Portuguese (Brazil)’,
‘pt-PT’ : ‘Portuguese (Portugal)’,
‘ro’: ‘Romanian’,
‘ru’: ‘Russian’,
‘sk’: ‘Slovak’,
‘sl’: ‘Slovenian’,
‘es’: ‘Spanish’,
‘sv’: ‘Swedish’,
‘tr’: ‘Turkish’,
‘uk’: ‘Ukrainian’,
‘vi’: ‘Vietnamese’,
‘aa-AA’: ‘Test Language’
}

if os.environ.get(“EXAMPLE_DOMAIN”): # generates a link for example domain
EXAMPLE_DOMAIN = os.environ.get(“EXAMPLE_DOMAIN”)
if os.environ.get(“DOC_SERV”): # generates links for document server
DOC_SERV_SITE_URL = os.environ.get(“DOC_SERV”)

How i got that default content in docx ?

I commented out the callbackurl in /edit of “action.py” and changed the return statement of getDownloadUrl as
def getDownloadUrl(filename, req, isServerUrl = True):
host = getServerUrl(isServerUrl, req)
curAdr = f’&userAddress={req.META[“REMOTE_ADDR”]}’ if isServerUrl else “”
#return f’{host}/download?fileName={filename}{curAdr}’
return f’{host}’

Thanks for the response !

@yokesh
I apologize for the late response(

Try using the server ip 192.168. … when running python example…
image

It looks like the problem is in the local network settings with docker (using a virtual machine).
Using ip addresses 192.168… should work out correctly.

The easiest way is to reinstall the Python example or change the value of action.py to the original ones.