tika-python icon indicating copy to clipboard operation
tika-python copied to clipboard

No such file or directory: '/tmp/tika-server.jar'

Open Ragehead opened this issue 4 years ago • 2 comments

Why I'm getting this message when I try to use tika?

Traceback (most recent call last):
  File "/usr/share/pyshared/test.py", line 124, in <module>
    raw = parser.from_file(str(path))
  File "/home/fred/.local/lib/python3.8/site-packages/tika/parser.py", line 40, in from_file
    output = parse1(service, filename, serverEndpoint, headers=headers, config_path=config_path, requestOptions=requestOptions)
  File "/home/fred/.local/lib/python3.8/site-packages/tika/tika.py", line 337, in parse1
    status, response = callServer('put', serverEndpoint, service, f,
  File "/home/fred/.local/lib/python3.8/site-packages/tika/tika.py", line 532, in callServer
    serverEndpoint = checkTikaServer(scheme, serverHost, port, tikaServerJar, classpath, config_path)
  File "/home/fred/.local/lib/python3.8/site-packages/tika/tika.py", line 595, in checkTikaServer
    if not checkJarSig(tikaServerJar, jarPath):
  File "/home/fred/.local/lib/python3.8/site-packages/tika/tika.py", line 615, in checkJarSig
    with open(jarPath, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tika-server.jar'

Ragehead avatar Jul 29 '21 14:07 Ragehead

me too. Does anyone keep maintaining this project?

leonlee723 avatar Aug 24 '21 00:08 leonlee723

Hey @ragehead , Just download the jar file from https://repo1.maven.org/maven2/org/apache/tika/tika-server/

Suppose you downloaded tika-server-1.24.jar and tika-server-1.24.jar.md5 in a folder tika-server. Then just copy those two files to /tmp/ like sudo cp tika-server/tika-server-1.24.jar /tmp/tika-server.jar and sudo cp tika-server/tika-server-1.24.jar.md5 /tmp/tika-server.jar.md5

Thanks

ujjawalcse avatar May 29 '22 11:05 ujjawalcse

So some systems won't let you write to /tmp and as such it won't create the log files that tika-python needs to read for the background tika server. Recommend you make sure your system permissions allow writing to /tmp. Thanks.

chrismattmann avatar Dec 31 '22 21:12 chrismattmann