Symbolic linking issue in local postgres instance on MacOS - postgresql

Having recently upgraded postgresql and gdal using homebrew, I am stuck with a could not load library error when trying to run a GDAL command that creates a connection to a local postgres database:
ERROR 1: ERROR: could not load library "/usr/local/lib/postgresql/postgis-3.so": dlopen(/usr/local/lib/postgresql/postgis-3.so, 10): Symbol not found: _hash_bytes
Referenced from: /usr/local/lib/postgresql/postgis-3.so
Expected in: /usr/local/opt/postgresql/bin/postgres
in /usr/local/lib/postgresql/postgis-3.so
ERROR 1: PROJ: proj_identify: Cannot find proj.db
ERROR 1: ERROR: could not load library "/usr/local/lib/postgresql/postgis-3.so": dlopen(/usr/local/lib/postgresql/postgis-3.so, 10): Symbol not found: _hash_bytes
Referenced from: /usr/local/lib/postgresql/postgis-3.so
Expected in: /usr/local/opt/postgresql/bin/postgres
in /usr/local/lib/postgresql/postgis-3.so
I am confused by the "Referenced from: Expected in:" part
When I check the folder /usr/local/lib/postgresql/ , I see that the postgis-3.so file is symbolically linked to another directory
cd /usr/local/lib/postgresql/
ls -l
returns
...
postgis-3.so -> ../../Cellar/postgis/3.0.3/lib/postgresql/postgis-3.so
How should this error be interpreted and are there any suggestions on further steps to take in this case?

Related

Osm2pgsql failed due to ERROR: Error loading lua config: ...l/share/lua/5.2/osml10n/get_localized_name_from_tags.lua:1: module 'unaccent' not found

i am using this project from github :( https://github.com/giggls/osml10n/blob/master )
i have completed all the installation steps but when i run this command (:osm2pgsql -G -O flex -d osm -S openstreetmap-carto-hstore-only-l10n.lua ../openstreetmap-carto-de/data/gcc-states-latest.osm.pbf
) i have the following error can anyone tell me how can u fix it.
ERROR (
Osm2pgsql failed due to ERROR: Error loading lua config:...l/share/lua/5.2/osml10n/get_localized_name_from_tags.lua:1: module 'unaccent' not found:
no field package.preload['unaccent
no file '/usr/local/share/lua/5.2/unaccent.lua'
no file '/usr/local/share/lua/5.2/unaccent/init.lua'
no file '/usr/local/lib/lua/5.2/unaccent.lua')

after buildind lammps when i run the executable this problem is shown

after completion of installation when running the executable this error is showing
Local host: csehpc
Local device: mlx4_0
./lmp: symbol lookup error: ./lmp: undefined symbol: _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE17find_first_not_ofEPKcmm

How to solve Taskhash mismatch and metadata is not deterministic in Yocto project build?

I am facing "Taskhash mismatch" & "The metadata is not deterministic and this needs to be fixed" error in Yocto project build. This issue arises without any obvious reasons. With a perfectly good source code repo, the build is success sometime, while it fails some time. There is no change in source code/recipe or any other build parameters.
Error log:
ERROR: When reparsing /home/user/my_project/yocto/sub_project-yocto/meta-subproject/meta-base/recipes-core/sub_project-rootfs-base/sub_project-rootfs-base.bb:do_populate_lic, the basehash value changed from e0bfa2ad64f24d189d23f9d84918c74a7253e0d7e9c7fea4e3346cbc473d43da to c108c533ec82c43aa15730e4ca9c9838f87133e63417f40af0de8ca8cb43f51a. The metadata is not deterministic and this needs to be fixed.
ERROR: The following commands may help:
ERROR: $ bitbake sub_project-rootfs-base -cdo_populate_lic -Snone
ERROR: Then:
ERROR: $ bitbake sub_project-rootfs-base -cdo_populate_lic -Sprintdiff
ERROR: sub_project-rootfs-base-1.0+gitAUTOINC+db239d9f5b-r2 do_package_qa: Taskhash mismatch 87d8616452c2be01481a9034e9147f0270a57a3f64f85cde65076863b8123c7c versus 9a7fd3b27e62140001d77ab75dbc2026dac8e6c8ca93a487b1857a76f2b6b2yy for /home/user/my_project/yocto/sub_project-yocto/meta-subproject/meta-base/recipes-core/sub_project-rootfs-base/sub_project-rootfs-base.bb:do_package_qa
ERROR: Taskhash mismatch 87d8616452c2be01481a9034e9147f0270a57a3f64f85cde65076863b8123c7c versus 9a7fd3b27e62140001d77ab75dbc2026dac8e6c8ca93a487b1857a76f2b6b2yy for /home/user/my_project/yocto/sub_project-yocto/meta-subproject/meta-base/recipes-core/sub_project-rootfs-base/sub_project-rootfs-base.bb:do_package_qa
ERROR: sub_project-rootfs-base-1.0+gitAUTOINC+db239d9f5b-r2 do_package_write_rpm: Taskhash mismatch 9a7fd3b27e62140001d77ab75dbc2026dac88qc8ca93a487b1857a76f2b6b2yy versus 9a7fd3b27e6217l0001d77ab75dbc2026dac8e6c8ca93a487b1857a76f2b6b2yy for /home/user/my_project/yocto/sub_project-yocto/meta-subproject/meta-base/recipes-core/sub_project-rootfs-base/sub_project-rootfs-base.bb:do_package_write_rpm
ERROR: Taskhash mismatch 9a7fd3b27e62140001d77ab75dbc2026dac88qc8ca93a487b1857a76f2b6b2yy versus 9a7fd3b27e6217l0001d77ab75dbc2026dac8e6c8ca93a487b1857a76f2b6b2yy for /home/user/my_project/yocto/sub_project-yocto/meta-subproject/meta-base/recipes-core/sub_project-rootfs-base/sub_project-rootfs-base.bb:do_package_write_rpm
I resolved this issue by doing two of the following action.
Clean the recipe which throws error during build using following command
bitbake -c cleansstate sub_project-rootfs-base
Update the bb file timestamp by doing empty write or by touching file.
Open the bb file using your editor - vim /home/user/my_project/yocto/sub_project-yocto/meta-subproject/meta-base/recipes-core/sub_project-rootfs-base/sub_project-rootfs-base.bb
Write the file by clicking save button or in vim writing ":w" command
Close the file using "x" button or ":q" command.
Rebuild the project as usual.
Edit : In case there are multiple bitbake recipes showing this error, you can touch all bb files and build again. Go into your yocto folder and run following command. This will take some to touch all file and significantly higher time to rebuild the project.
find . -type f -name "*.bb" -exec touch {} +

How to solve error on docker:layers_calculator to compute the Merkle tree on private tangle?

I want to setup a private tangle on my own virtual machine with Ubuntu 18.04, 4GB RAM and 20GB memory.
I have follow this instructions: https://docs.iota.org/docs/compass/0.1/how-to-guides/set-up-a-private-tangle. Every command works fine until reach this one: bazel run //docker:layers_calculator.
It shows an error as follows:
Starting local Bazel server and connecting to it...
ERROR: /home/istabraq/compass/third-party/maven_deps.bzl:3:5: Traceback (most recent call last):
File "/home/istabraq/compass/WORKSPACE", line 42
maven_jars()
File "/home/istabraq/compass/third-party/maven_deps.bzl", line 3, in maven_jars
native.maven_jar(<4 more arguments>)
type 'struct' has no method maven_jar()
ERROR: error loading package '': Encountered error while reading extension file 'protobuf_deps.bzl': no such package '#com_google_protobuf_deps//': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'protobuf_deps.bzl': no such package '#com_google_protobuf_deps//': error loading package 'external': Could not load //external package
INFO: Elapsed time: 4.743s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
How can I solve this problem? what I have missed?
read carefully the message given after running bazel installer:
Make sure you have "/home/yourusername/bin" in your path. You can also activate bash completion by adding the following line to your :
source /home/yourusername/.bazel/bin/bazel-complete.bash
You can check with: "bazel info" or "bazel version"
Unfortunately, there are further errors:
https://github.com/iotaledger/compass/issues/142
I have solve this issue by using this commands:
Step 3: Set up your environment
If you ran the Bazel installer with the --user flag as above, the Bazel executable is installed in your $HOME/bin directory. It’s a good idea to add this directory to your default paths, as follows:
export PATH="$PATH:$HOME/bin"
You can also add this command to your ~/.bashrc or ~/.zshrc file to make it permanent.
reference:
https://docs.bazel.build/versions/master/install-ubuntu.html

'shp2pgsql' is not recognized : command not found error

I am trying to import shape file to postgis. I have problem configuring shp2pgsql.
I am getting this error :
-bash: shp2pgsql: command not found
I have read different threads without getting any results like: https://github.com/Homebrew/homebrew/issues/19213
macbook$ locate shp2pgsql
/Library/PostgreSQL/9.3/PostGIS/man/shp2pgsql.1
/Library/PostgreSQL/9.3/bin/shp2pgsql
/usr/bin/shp2pgsql
macbook$ otool -L shp2psql
otool: can't open file: shp2psql (No such file or directory)
I tried to run which command
macbook$ which shp2pgsql
I got nothing .
macbook$ ls /usr/bin/shp2pgsql
/usr/bin/shp2pgsql
First guess was that "shp2pgsql" is not linked. How can I link /usr/bin/shp2pgsql in postgres PostgreSQL when I tried to run :
sudo ln -s /Library/PostgreSQL/9.3/bin/shp2pgsql /usr/bin/shp2pgsql
It says that : : ln: /usr/bin/shp2pgsql: File exists
UPDATE
When I linked shp2pgsql
dyld: Library not loaded: #loader_path/../lib/liblwgeom-2.1.1.dylib
Referenced from: /Library/PostgreSQL/9.3/bin/shp2pgsql
Reason: image not found
When i tried to locate liblwgeom
macbook$ locate liblwgeom
/Library/Caches/Homebrew/Formula/liblwgeom.brewing
/Library/Caches/Homebrew/liblwgeom-2.1.1.tar.gz
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom-2.1.1.dylib
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom.a
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom.dylib
/Library/PostgreSQL/9.3/lib/postgresql/liblwgeom.la
/usr/local/Cellar/liblwgeom
/usr/local/Cellar/liblwgeom/2.1.1
/usr/local/Cellar/liblwgeom/2.1.1/COPYING
/usr/local/Cellar/liblwgeom/2.1.1/ChangeLog
/usr/local/Cellar/liblwgeom/2.1.1/INSTALL_RECEIPT.json
/usr/local/Cellar/liblwgeom/2.1.1/LICENSE.TXT
/usr/local/Cellar/liblwgeom/2.1.1/NEWS
/usr/local/Cellar/liblwgeom/2.1.1/TODO
/usr/local/Cellar/liblwgeom/2.1.1/include
/usr/local/Cellar/liblwgeom/2.1.1/include/liblwgeom.h
/usr/local/Cellar/liblwgeom/2.1.1/lib
/usr/local/Cellar/liblwgeom/2.1.1/lib/liblwgeom-2.1.1.dylib
/usr/local/Cellar/liblwgeom/2.1.1/lib/liblwgeom.a
/usr/local/Cellar/liblwgeom/2.1.1/lib/liblwgeom.dylib
/usr/local/Library/Formula/liblwgeom.rb
/usr/local/opt/liblwgeom
Any thoughts how to resolve this problem.
Write echo $PATH in your bash console and tell us what it says.
Probably this can be fixed by
PATH=$PATH:/Library/PostgreSQL/9.3/bin/
export PATH