Django.db.utils.OperationalError: (1156, 'Got packets out of order') - ubuntu-20.04

I have got some problems when I used mysql with django in ubuntu=20.04.
I tried to change the default sqlite3 database in django to mysql.
When I made python manage.py makemigrations it was fine.
However, when I run python manage.py migrate, it shows an error like this
Django.db.utils.OperationalError: (1156, 'Got packets out of order')
Any one may help me please?

Related

Rust, Windows 10: Diesel doesn't work, diesel setup provides no output

I am new to Rust, and I wanted to try Diesel with Postgres. I have followed the steps described here:
https://diesel.rs/guides/getting-started
But unfortunately, when it comes do diesel setup, nothing happens. I receive no output, no error messages, nothing. I have installed diesel_cli with the command install diesel_cli --no-default-features --features postgres , I have Postgres 13 on Windows 10.
This is what I have in my .env file : DATABASE_URL=postgres://postgres:pwd#localhost:5432/diesel (with pwd being my password). I have created a database named "diesel", and it is running on the Postgres server, with default settings. It is currently empty, with no tables.
I receive no output from diesel setup or diesel migrate generate create_posts. Not even an error message.
Did someone else encounter this problem as well? Any idea what can cause this?
If you use powershell in windows, it will not give error message.
echo $LASTEXITCODE on powershell will give the error code.
get lastexitcode
Using command line will give the error message.
I added this "C:\Program Files\PostgreSQL\13\bin" to my path environment variable.
Now diesel setup and other cli commands are working.
Reference

Open Source Greenplum: GPFDIST error 'Segmentation fault' when selecting from external table

I'm trying to simply setup an Open Source Greenplum instance and have been hitting the same issue regarding GPFDIST for days! Simply put, I do a full installation from scratch on CentOS 7.6 (can provide further details regarding setup if needed) installing OS GPDB software version 5.18 with GPORCA disabled. Full command for the compile is:
./configure --prefix=/usr/local/gpdb --with-perl --with-python --with-libxml --with-gssapi --with-includes=/usr/local/gpdb/include --with-libs=/usr/local/gpdb/lib --disable-orca
This compiles successfully, and the following make/make install commands too complete without issue. The initialisation of the Greenplum database itself also succeeds, and I can then go into a database and create tables, insert data and run queries like normal.
But if I try to select from an external table, such as the following:
create external table test_external_table
(testing smallint
)
location ('gpfdist://mdw:8080/test_data.csv')
format 'csv' (header delimiter '|')
;
with GPFDIST run as follows:
gpfdist -d /home/gpadmin/test/ -p 8080 -l /home/gpadmin/greenplum/logs/gpfdist_log 2>&1 &
then I get two errors; one from the external table, and one from GPFDIST. These are as follows:
External Table Returns:
ERROR: connection with gpfdist failed for gpfdist://mdw:8080/test_data.csv. effective url: http://127.0.0.1:8080/test_data.csv. error code = 104 (Connection reset by peer) (seg0 slice1 127.0.0.1:6000 pid=27962)
GPFDIST Returns:
[1]+ Segmentation fault gpfdist -d /home/gpadmin/test -p 8080 -l /home/gpadmin/greenplum/logs/gpfdist_log 2>&1
I have removed everything that isn't on the OS GPDB GitHub installation guide (for a 'bare-bones' setup), so I don't think that is causing the issue. I have tried everything to do with the hostname and network firewall, and it's all perfect as far as I can see.
I have also downloaded the same version of GPDB (5.18) from Pivotal and installed that version on the same instance simultaneously, and GPFDIST works perfectly fine.
I have also tried OS GPDB 5.17, 6 beta and 7 beta, and I get the same issue for all of them.
Any ideas at all on what might be causing this is VERY much appreciated, as I'm slowly going insane trying to figure this out now.
Thank you very much in advance for any help.
-- Edit --
Okay.. Having nearly chewed my own arm off in sheer frustration at trying to install debuginfo stuff on CentOS 7, I've finally generated a core dump with gdb. I then run:
gdb -c core_dump.<pid>
and get the following output:
Core was generated by `gpfdist -d /home/gpadmin/test -p 8080 -l /home/gpadmin/greenplum/logs/gpfdist_log'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f4f2c07bdff in ?? ()
But I have absolutely no idea what that means... Totally honest, I'm a little over my head with this now and really am stuck on how to proceed.
The connection reset by peer only indicates that the other end of the socket had dropped (...in this case, gpfdist because it crashed out).
Setup your gpfdist and try a wget to a hosted file adding:
--header='X-GP-PROTO:0'
You will need to add the header to avoid having the request rejected.
Are you able to retrieve a file there? Or does that also crash out?
If that crashes out, it's nothing to do with the database - and you will likely need a core dump to determine what the segfault is about (r/w permissions, memory, ...).
I've finally managed to solve this issue. Should anyone come looking with a similar problem, make sure you are installing Libevent version 1.4[.15], and nothing above that.
I had 2.2.0 installed, and whilst Greenplum sees this as fine, it actually doesn't work for it. Unfortunately, I did have to do an entire system installation from scratch to seemingly get it to work, as just installing Libevent 1.4 on the old system with Greenplum already compiled did not work for me.

postgres bad connection localhost

On UBUNTU, I have a ruby app with a postgresql database on my localhost.
Everything was working fine yesterday, but today my database was gone. I was still able to open the app. Then I got an error saying something like,
run rails db:migrate
After I ran the command I started getting
PG::ConnectionBad at /
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
None of the config files were changed since yesterday.
I use docker-compose up to start the server and apparently it starts the connection but I still cannot access my localhost.
What could be the problem here?
Thank you in advance
Check the logs in your DB, if the DB is running on docker as well then maybe it's not finishing the DB boot correctly.
If this is the case, run the DB container manually first with the same options as in your docker-compose and then check docker logs for that container.

Postgresql V9.6 on OSX how do I open pg_hba.conf file and edit it? (rails 5.1 related)

Hi all~~ I'm only 3 month into the coding scene, so forgive my ignorance.
Environment: ruby 2.3.3/rails 5.1/PG9.6.1 installed through homebrew on Mac OSX
My Goal: Trying to build a production ready rails app using Latest postgresql
Problem: as soon as I deployed my rails project and start testing my local server, I ran into "PG::ConnectionBad"/"fe_sendauth: no password supplied"/ #connection = PGconn.connect(#connection_parameters) . error
What I trying to do: I learned I need to config my pg_hba.conf file to set one of the encrypt method to MD5. via suggestion here
Rails + Postgres fe_sendauth: no password supplied
Progress: I was able to locate pg_hba.conf's directory by type in "locate pg_hba.conf"
It's in /Users/mypcname/PostgreSQL/pg96/init/pg_hba.conf
But now I can't find a way to execute the file to do the editing
Usually type in file's extension would let me exceute the file, but in this cause, it says someone about "superuser session", so I tried sudo su /Users/mypcname/PostgreSQL/pg96/init/pg_hba.conf
And got this
su: unknown login: /Users/mypcname/PostgreSQL/pg96/init/pg_hba.conf
So this is where I got stuck, any help and suggestion would be greatly appreciated, thanks in advance

Installing MarkLogic 8 on CentOS 6.7 x64 via DigitalOcean

Installing MarkLogic 8 on CentOS 6.7 x64 via DigitalOcean
Okay so I downloaded the rpm file from:
https://developer.marklogic.com/download/binaries/8.0/MarkLogic-8.0-3.2.x86_64.rpm
I installed it with:
sudo yum install MarkLogic-8.0-3.2.x86_64.rpm
Started it:
sudo /etc/init.d/MarkLogic start
Went to admin interface:
my_ip_address:8001
I skip joining a cluster
I type in admin for user
Type in a password and confirm it
Realm is public
I click OK and...
I get redirected to:
my_ip_address:8001/security-install-go.xqy
And get this:
No data received
ERR_EMPTY_RESPONSE
Hide details
Unable to load the webpage because the server sent no data.
Reload this webpage
Press the reload button to resubmit the data needed to load the page.
Okay I got it to work.
The only difference I can see this time around was I followed this script (save the nginx stuff):
https://github.com/jmakeig/marklogic-bootstrapping/blob/master/digitalocean/bootstrap.sh
Actually, someone else ran into this and after investigating everything else I tried, this was the answer:
http://developer.marklogic.com/pipermail/general/2015-January/016311.html
The MarkLogic data directory /var/opt/MarkLogic wasn't owned by the daemon user

Resources