Code Monkey home page Code Monkey logo

Comments (9)

therek avatar therek commented on August 18, 2024 7

I had the same problem and it turned out that pyosmium-get-changes uses /usr/bin/python3 while Python scripts supplied with Nominatim refer to /usr/bin/python which in ubuntu:disco image is Python 2.7. Also, user postgres have no write permission to /app/src/build.

Here's the patch for Dockerfile I've used to workaround it.

--- 3.3/Dockerfile.orig	2019-05-28 13:52:56.347074000 +0200
+++ 3.3/Dockerfile	2019-06-05 16:19:29.442759114 +0200
@@ -40,6 +40,8 @@

 # Load initial data
 RUN curl http://www.nominatim.org/data/country_grid.sql.gz > /app/src/data/country_osm_grid.sql.gz
+RUN sed -i -e 's|bin/python|bin/python3|' /app/src/utils/*.py
+RUN chmod o=rwx /app/src/build

 EXPOSE 5432
 EXPOSE 8080

You can apply it with patch -p0 < patch-Docker.

from nominatim-docker.

grachevko avatar grachevko commented on August 18, 2024

Same issue

from nominatim-docker.

maxze avatar maxze commented on August 18, 2024

The issue here seems to be that the Pyosmium binary cannot be found where the update script is looking for it. Though it should be installed, according to the Dockerfile.

Run the command

whereis pyosmium-get-changes

inside the container and see what it shows.

Now go into your locals.php file and make sure the line

@define('CONST_Pyosmium_Binary', '/usr/local/bin/pyosmium-get-changes');

shows the correct path. I remember having that problem some time ago.

I remember having that problem some time ago and that was the reason why.

Edit:

I just tried it and my solution doesn't seem to work at all. It must have something to do with the fact that osmium is now installed without the --user argument.

from nominatim-docker.

I1yi4 avatar I1yi4 commented on August 18, 2024

I have the same issue. I have two docker container with postgres and apache but when I trying update db using command docker exec -it nominatim sudo -u postgres ./src/build/utils/update.php --import-osmosis-all I got

Currently at sequence 967 (04/07/2019 20:08:23) - 1 indexed
/usr/local/bin/pyosmium-get-changes --server http://download.geofabrik.de/europe/russia-european-part-updates -o /app/src/build/osmosischange.osc -s 30 -I 967
Traceback (most recent call last):
  File "/usr/local/bin/pyosmium-get-changes", line 243, in <module>
    exit(main(sys.argv[1:]))
  File "/usr/local/bin/pyosmium-get-changes", line 224, in main
    outhandler = WriteHandler(options.outfile)
RuntimeError: Open failed for '/app/src/build/osmosischange.osc': Permission denied

CONST_Pyosmium_Binary have currect path. Someone can help me with this issue?

from nominatim-docker.

therek avatar therek commented on August 18, 2024

@Wilfli you can use the patch I've supplied above. There's also a pull request #71 with that change.

from nominatim-docker.

I1yi4 avatar I1yi4 commented on August 18, 2024

Yes it work. Thanks

from nominatim-docker.

theHellDog avatar theHellDog commented on August 18, 2024

I had the same problem and it turned out that pyosmium-get-changes uses /usr/bin/python3 while Python scripts supplied with Nominatim refer to /usr/bin/python which in ubuntu:disco image is Python 2.7. Also, user postgres have no write permission to /app/src/build.

Here's the patch for Dockerfile I've used to workaround it.

--- 3.3/Dockerfile.orig	2019-05-28 13:52:56.347074000 +0200
+++ 3.3/Dockerfile	2019-06-05 16:19:29.442759114 +0200
@@ -40,6 +40,8 @@

 # Load initial data
 RUN curl http://www.nominatim.org/data/country_grid.sql.gz > /app/src/data/country_osm_grid.sql.gz
+RUN sed -i -e 's|bin/python|bin/python3|' /app/src/utils/*.py
+RUN chmod o=rwx /app/src/build

 EXPOSE 5432
 EXPOSE 8080

You can apply it with patch -p0 < patch-Docker.

I think better way is to use update-alternatives tool to change default version of python.
Like update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1

from nominatim-docker.

ErwanTremiot avatar ErwanTremiot commented on August 18, 2024

It seems that the PR #71 from @therek has been merged, but it only provides a fix for version 3.3 and not for 3.4 version that has the same problem.
I tested the solution from @theHellDog on the 3.4 version and it worked for me:

# Fix python default version
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 3
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 2

from nominatim-docker.

philipkozeny avatar philipkozeny commented on August 18, 2024

@ErwanTremiot where exactly do you see the problem? I have built 3.4 with no changes regarding that issue and everything works as expected.

from nominatim-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.