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

Can't access API #11

Open
andyrozman opened this issue Nov 1, 2024 · 1 comment
Open

Can't access API #11

andyrozman opened this issue Nov 1, 2024 · 1 comment

Comments

@andyrozman
Copy link

Hi !
So I am running on Ubuntu 24.04, I succesfully downloaded your image (3.19) and then I issued command

"docker run libreofficedocker/libreoffice-unoserver:3.19"

Docker started:
`INFO:unoserver:Starting unoserver.
INFO:unoserver:Command: libreoffice --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///tmp/tmpb40gxfpl --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
INFO:unoserver:Server PID: 110


/ / / /___ ____ ________ ______ _____ _____
/ / / / __ / __ / / _ / / | / / _ / /
/ /
/ / / / / /
/ (
) _/ / | |/ / / /
_
/
/
/
/_
//___// |/_//___
/ __ / ____/ / __/ / | / __ / /
/ /
/ / _/ _ \ / / / /| | / /
/ // /
/ , / /
/ // / / ___ |/ __// /
/
/ |
/
///// // |// /___/

  • Alpine Linux version: 3.19.2
  • LibreOffice 7.6.7.2 60(Build:2)
  • Python version: Python 3.11.9
  • openjdk 11.0.23 2024-04-16
  • OpenJDK Runtime Environment (build 11.0.23+9-alpine-r0)
  • OpenJDK 64-Bit Server VM (build 11.0.23+9-alpine-r0, mixed mode)

Starting REST API server...

  • wait-for-it --quiet -t 30 127.0.0.1:2002 --strict -- unoserver-rest-api --unoconvert-bin /usr/bin/unoconvert-lockrun --unoconvert-timeout 1m
    unoserver-rest-api 2024/11/01 17:48:04 Server working directory '/tmp/unodata-2078846689'
    unoserver-rest-api 2024/11/01 17:48:04 Server is running at 0.0.0.0:2004
    unoserver-rest-api 2024/11/01 17:48:04 Server is running pid is 165`

And when I try to issue command:

curl -s -v \ --request POST \ --url http://127.0.0.1:2004/request \ --header 'Content-Type: multipart/form-data' \ --form "file=@${CURRENT_DIR}/${file}" \ --form 'convert-to="txt:Text (encoded):UTF8"' \ --output '${file}.txt'

I get such response:

`* Trying 127.0.0.1:2004...

  • connect to 127.0.0.1 port 2004 from 127.0.0.1 port 55942 failed: Connection refused
  • Failed to connect to 127.0.0.1 port 2004 after 0 ms: Couldn't connect to server
  • Closing connection
    `

I tried both 2004 and 2002 ports and same result...

Could you maybe extend your README to give exact examples on how to use... Even how to start correctly.. Not everybody is docker expert...

I tried to get this unoserver running locally, but Ubuntu is being very uncooperative... And running conversion locally takes forever if you have a lot of files...

@andyrozman
Copy link
Author

Ok solved the part of issue.. After running with -p 2004:2004 it started working...

Now if I send the full command to convert (like I would locally)

	curl -s -v \
	   --request POST \
	   --url http://172.17.0.1:2004/request \
	   --header 'Content-Type: multipart/form-data' \
	   --form "file=@${CURRENT_DIR}/${file}" \
	   --form 'convert-to="txt:Text (encoded):UTF8" ' \
	   --output "${file}.txt"

This doesn't work. I am converting html to txt, with unicode.

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

No branches or pull requests

1 participant