Could not open extension control file citext.control - python-3.x

Environment(s)
Ubuntu 20.04 & Debian 10 with Python 3.8 or 3.7, respectively.
Postgresql versions 11, 12, and 14 have been tried.
Psycopg2-binary 2.8.6
Overview
I'm attempting to install a Django project, and I'm getting this error:
psycopg2.errors.UndefinedFile: could not open extension control file "/usr/share/pgsql/extension/citext.control": No such file or directory
The psycopg devs informed me this is likely an issue with the postgresql-contrib libraries. Similarly, others have been able to fix this error by installing postgresql-contrib, however, this does not work for me. I've also tried installing postgresql-12.
I can see that citext.control is available in /usr/share/postgresql/12/extension/citext.control, so I tried ln -s /usr/share/postgresql/12 /usr/share/pgsql with no effect.
I also ran CREATE EXTENSION citext; in Postgres, also without effect.
Any support with this would be greatly appreciated, as I was hoping to have this project live already!
Thanks so much.
Trace
Running migrations:
Applying core.0043_install_ci_extension_pg...Traceback (most recent call last):
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedFile: could not open extension control file "/usr/share/pgsql/extension/citext.control": No such file or directory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 16, in <module>
execute_from_command_line(sys.argv)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/core/management/__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/user/janeway/src/utils/management/commands/install_janeway.py", line 58, in handle
call_command('migrate')
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/core/management/__init__.py", line 131, in call_command
return command.execute(*args, **defaults)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 202, in handle
post_migrate_state = executor.migrate(
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/migrations/executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/migrations/migration.py", line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/contrib/postgres/operations.py", line 17, in database_forwards
schema_editor.execute("CREATE EXTENSION IF NOT EXISTS %s" % schema_editor.quote_name(self.name))
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/backends/base/schema.py", line 136, in execute
cursor.execute(sql, params)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/user/venvs/janeway/lib/python3.8/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.OperationalError: could not open extension control file "/usr/share/pgsql/extension/citext.control": No such file or directory

Have you tried installing python3-psycopg2 from the packaging system instead?
My Ubuntu 20 setup has this installed, and postgresql connections work with django.
ii python3-psycopg2 2.8.4-2 amd64 Python 3 module for PostgreSQL

I had installed postgresql-contrib on the local django server rather than the remote DB server. Installing on the same server as Postgresql resolved the issue.

Related

AWS SAM giving error Unsupported Lambda runtime nodejs18.x

I am trying to run a simple lambda function using AWS sam, version(1.57.0)
I've installed in my ubuntu system nodejs version 14.18.3
When I try to run the project it gives errorUnsupported Lambda runtime nodejs18.x
Below is the full stacktrace
Invoking index.handler (nodejs18.x)
Traceback (most recent call last):
File "samcli/__main__.py", line 12, in <module>
File "click/core.py", line 829, in __call__
File "click/core.py", line 782, in main
File "click/core.py", line 1259, in invoke
File "click/core.py", line 1259, in invoke
File "click/core.py", line 1066, in invoke
File "click/core.py", line 610, in invoke
File "click/decorators.py", line 73, in new_func
File "click/core.py", line 610, in invoke
File "samcli/lib/telemetry/metric.py", line 176, in wrapped
File "samcli/lib/telemetry/metric.py", line 126, in wrapped
File "samcli/lib/utils/version_checker.py", line 41, in wrapped
File "samcli/cli/main.py", line 86, in wrapper
File "samcli/commands/local/invoke/cli.py", line 106, in cli
File "samcli/commands/local/invoke/cli.py", line 183, in do_cli
File "samcli/commands/local/lib/local_lambda.py", line 144, in invoke
File "samcli/lib/telemetry/metric.py", line 240, in wrapped_func
File "samcli/local/lambdafn/runtime.py", line 177, in invoke
File "samcli/local/lambdafn/runtime.py", line 88, in create
File "samcli/local/docker/lambda_container.py", line 91, in __init__
ValueError: Unsupported Lambda runtime nodejs18.x
[43955] Failed to execute script __main__
I did have node version 18 installed in the system prior to this. I thought that may be giving the issue so I uninstalled that version and installed version 14.
I don't have any idea why sam is running it on node version 18
I just recently looked into this as well since Node 18 is the current LTS. If you go to the Serverless Image Repository you'll see that AWS SAM doesn't currently have an image for Node 18. There's an explanation about this in this Github issue.

Restore RethinkDB backup on MacOS Big Sur

My local Rethink database disappeared after upgrading to MacOS 11 (“Big Sur”). But that's alright, as I have a backup. But I can't, for the life of me, restore it.
rethinkdb restore [file] and rethinkdb import [file] didn't work, but after some googling I found that I had to install the python tools (pip3 install rethinkdb). I did that, but now I get this error:
% rethinkdb restore rethinkdb_dump_2020-11-21T20:35:20.tar.gz > bug.log
Traceback (most recent call last):
File "/usr/local/bin/rethinkdb-restore", line 10, in <module>
sys.exit(main())
File "/Users/$USER/Library/Python/3.8/lib/python/site-packages/rethinkdb/_restore.py", line 339, in main
do_restore(options)
File "/Users/$USER/Library/Python/3.8/lib/python/site-packages/rethinkdb/_restore.py", line 315, in do_restore
_import.import_tables(options, sources)
File "/Users/$USER/Library/Python/3.8/lib/python/site-packages/rethinkdb/_import.py", line 1359, in import_tables
progress_bar.start()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
return Popen(process_obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_thread._local' object
I've tried to uninstall RethinkDB and the Python tools and reinstall both. Same outcome.
I was able to downgrade to python 3.7, reinstall the rethinkdb python driver and made it further in the rethinkdb restore process

Cant start docker `OSError: [Errno 8] Exec format error: '/usr/local/bin/docker-credential-ecr-login'`

I want to start my docker-compose and I always get this error.
Docker Desktop tells me I'm logged in. I also rebooted once and logged in again.
I don't quite understand why that's not possible. If I pull other Docker Containers in another project, everything works.
We dont use paython in our project.
$ docker --version
Docker version 19.03.8, build afacb8b
$ docker-compose --version
docker-compose version 1.25.4, build 8d51620a
$ python --version
Python 3.7.4
macOS Catalina 10.15.3
Here is the stacktrace
> docker-compose up
Pulling mongo (mongo:latest)...
Traceback (most recent call last):
File "site-packages/docker/credentials/store.py", line 80, in _execute
File "subprocess.py", line 411, in check_output
File "subprocess.py", line 488, in run
File "subprocess.py", line 800, in __init__
File "subprocess.py", line 1551, in _execute_child
OSError: [Errno 8] Exec format error: '/usr/local/bin/docker-credential-ecr-login'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/docker/auth.py", line 264, in _resolve_authconfig_credstore
File "site-packages/docker/credentials/store.py", line 35, in get
File "site-packages/docker/credentials/store.py", line 104, in _execute
docker.credentials.errors.StoreError: Unexpected OS error "Exec format error", errno=8
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 6, in <module>
File "compose/cli/main.py", line 72, in main
File "compose/cli/main.py", line 128, in perform_command
File "compose/cli/main.py", line 1077, in up
File "compose/cli/main.py", line 1073, in up
File "compose/project.py", line 548, in up
File "compose/service.py", line 361, in ensure_image_exists
File "compose/service.py", line 1250, in pull
File "compose/progress_stream.py", line 102, in get_digest_from_pull
File "compose/service.py", line 1215, in _do_pull
File "site-packages/docker/api/image.py", line 396, in pull
File "site-packages/docker/auth.py", line 48, in get_config_header
File "site-packages/docker/auth.py", line 324, in resolve_authconfig
File "site-packages/docker/auth.py", line 235, in resolve_authconfig
File "site-packages/docker/auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Unexpected OS error "Exec format error", errno=8')
[52557] Failed to execute script docker-compose
resetting the docker in docker-hub/settings solved the problem.

vagrant dcos install cassandra error

I followed the official vagrant-dcos instruction to install cassandra with minimal setup, by running command below, and got errors. Any idea?
dcos package install --options=examples/oinker/pkg-cassandra.json cassandra --yes
see error below:
Traceback (most recent call last):
File "cli/dcoscli/subcommand.py", line 101, in run_and_capture
File "cli/dcoscli/package/main.py", line 22, in main
File "cli/dcoscli/util.py", line 22, in wrapper
File "cli/dcoscli/package/main.py", line 36, in _main
File "dcos/cmds.py", line 43, in execute
File "cli/dcoscli/package/main.py", line 322, in _install
File "dcos/packagemanager.py", line 177, in get_package_version
File "dcos/packagemanager.py", line 359, in __init__
File "cli/env/lib/python3.5/site-packages/requests/models.py", line 866, in json
File "json/__init__.py", line 319, in loads
File "json/decoder.py", line 339, in decode
File "json/decoder.py", line 357, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Seems to be issue on cosmos. I restarted whole vagrant and it worked fine.

Mercurial failed to load in IIS 7 on windows 2008

Trying to setup Mercurial on windows 2008 using IIS 7. Followed the instruction from the following links,
http://stackingcode.com/blog/2011/02/24/running-a-mercurial-server-on-iis-7-5-windows-server-2008-r2
http://www.jeremyskinner.co.uk/mercurial-on-iis7/
After the setup, when I try to load the hgweb.cgi page, I keep having the error "DLL failed loading". Bellow shows the full error message.
From the error, it quite hard to know which DLL is missing. I have tried to find the missing DLL, but do not succeed. Has anyone having the same problem before? What's the missing DLL?
I'm using Murcurial 2.0 and python 2.6 with the precompiled installer. Tried both x86 and x64 installer, still has the same problem.
HTTP Error 502.2 - Bad Gateway The specified CGI application
misbehaved by not returning a complete set of HTTP headers. The
headers it did return are "Traceback (most recent call last): File
"C:\inetpub\wwwroot\hg\hgweb.cgi", line 24, in application =
hgweb(config) File "mercurial\hgweb__init__.pyc", line 26, in hgweb
File "mercurial\hgweb\hgwebdir_mod.pyc", line 89, in init File
"mercurial\hgweb\hgwebdir_mod.pyc", line 98, in refresh File
"mercurial\ui.pyc", line 43, in init File
"mercurial\demandimport.pyc", line 86, in getattribute File
"mercurial\demandimport.pyc", line 58, in _load File
"mercurial\scmutil.pyc", line 164, in File
"mercurial\scmutil.pyc", line 180, in opener File
"mercurial\demandimport.pyc", line 86, in getattribute File
"mercurial\demandimport.pyc", line 58, in _load File
"mercurial\util.pyc", line 27, in File
"mercurial\demandimport.pyc", line 86, in getattribute File
"mercurial\demandimport.pyc", line 58, in _load File
"mercurial\windows.pyc", line 13, in File
"mercurial\demandimport.pyc", line 86, in getattribute File
"mercurial\demandimport.pyc", line 58, in _load File
"mercurial\win32.pyc", line 11, in File
"mercurial\demandimport.pyc", line 86, in getattribute File
"mercurial\demandimport.pyc", line 58, in _load File
"ctypes__init__.pyc", line 10, in File
"mercurial\demandimport.pyc", line 114, in _demandimport File
"_ctypes.pyc", line 12, in File "_ctypes.pyc", line 10, in
__load ImportError: DLL load failed: The specified module could not be found. ".

Resources