Heroku pg:info gives 0 tables - database

my heroku app has dev plan
the app is useable and works and if I use pg:backups to download a backup and view it locally I can see that it has data..
however, when I do heroku pg:info it gives me 0 tables and 0 rows..
Connections: 0
Created: 2012-10-25 09:18 UTC
Data Size: 6.1 MB
Fork/Follow: Unavailable
PG Version: 9.1.6
Plan: Dev
Rows: 0/10000 (In compliance)
Status: available
Tables: 0
what's going on?

seems to resolve itself after a few days..

I have noticed that pg:info prints invalid data about your database when you create a new database with a new plan and you restore data into that new database from the old one. Especially the data size is shown as 0 even though it is the same size as your old database.

I observed this too. I just upgraded to a dev plan. It is really confusing.
I was able to "test" the upgrade on my staging app before doing it on production.

Related

ERROR: right sibling's left-link doesn't match: block 19 links to 346956 instead of expected 346955 in index "pg_depend_reference_index"

I have a DB in postgres. The DB is big with total size over 4TB and over 500,000 tables and many indexes. The DB is over 4 yr old.
Recently, the Pgsql DB server was not starting up, so I did the following to get it started again:
/usr/pgsql-9.3/bin/pg_resetxlog -f /var/lib/pgsql/9.3/data
/usr/pgsql-9.3/bin/pg_ctl -D /var/lib/pgsql/9.3/data stop
/usr/pgsql-9.3/bin/pg_ctl -D /var/lib/pgsql/9.3/data start
/usr/pgsql-9.3/bin/pg_ctl -D /var/lib/pgsql/9.3/data stop
systemctl restart postgresql-9.3
Since then I am getting the following error whenever I try to create a new table in the DB:
mps_schools=> create table test_test(hello int);
ERROR: right sibling's left-link doesn't match: block 19 links to 346956 instead of expected 346955 in index "pg_depend_reference_index"
I have tried re-indexing the DB, but it doesnt work. What more can I do?
pg_resetxlog destroyed your database, which is something that can easily happen, which is why you don't call it just because you don't get the database started. It's something of a last ditch effort to get a corrupted database up.
What can you do?
Best solution: restore from a backup from before you ran pg_resetxlog.
Perform an offline backup of your database.
Then start the database in single user mode:
postgres --single -P -D /your/database/directory yourdbname
Then try to reindex pg_depend:
REINDEX TABLE pg_catalog.pg_depend;
Exit the single user session, restart the database, run pg_dumpall to dump the database (and hope that it works), create a new database cluster with initdb and import the dump.
Don't continue using the cluster where you ran pg_resetxlog.

SqlIaaSExtension.Service broken on Azure SQL Server 2016 VM

Two month ago I deployed a new VM in Azure. I used the pre-configured "SQL Server 2016 SP1 Standard on Windows Server 2016" with 7 GB of RAM, and I chose the offered option to make backups automatically. Only other things I changed is add it to AD and put some databases (largest of ~2 GB size of backup file)
Now the server is running a service called SqlIaaSExtension.Service which I understand is for doing these backups as well as automated patching. You can find the services description here: MS service description
The problem is, it keeps on building up memory until after some weeks the SQL Server itself fails to execute larger queries. A restart of the SqlIaaSExtension.Service fixes the problem, but this is not at all a sustainable solution.
Does anybody know a working solution other then disabling the service and loosing the functionality altogether?
My setup (german):
I have meanwhile got some Information from Microsoft:
There seems to be an error in the SqlIaaSExtension.Service which is known to MS and will eventually be fixed.
Workaround is:
A: If you donĀ“t need the functionality - remove this service, as indicated in the service description.
B: If you want to keep the functionality - restart the service periodically. Possibly automate via Task-planner.
Updated info from MS 19/07/2017: Error is identified and should be fixed in the next 7-10 Days. A mitigation is restarting the service if necessary.
Updated info from MS 31/07/2017: Error should be fixed in Version 1.2.19.0. This can be checked from the Azure Portal under "extensions" in the VM-Menu.

SQLE_NOT_PUBLIC_ID Sybase mobilink error

I am working on an ios project that has a Sybase (ultralite) database that is synchronized with a Sybase Sql Anywhere 12 database using mobilink.
Everything was properly, until i decided today to add some fields to the main database so that they synchronize to the main database.
I have updated the schema of the consolidated database from the main engine, then i have updated the schema of the remote database from the consolidated engine, and then i mapped the added fields together, and I deployed a new ultralite database.
Please note that it's not the first time I do a similar task, i always add fields, and sync databases..
after the update, when i synchronize using the blank ultralite database, mobilink will fail giving only this error: Synchronization Failed: -1305 (MOBILINK_COMMUNICATIONS_ERROR) %1:201 %2: %3:0
I have researched Error Number 201 in sybase and it points to: SQLE_NOT_PUBLIC_ID
and in the sybase documentation the error's probably cause is:
"The option specified in the SET OPTION statement is PUBLIC only. You cannot define this option for any other user."
I have tried to redeploy, I have tried to move the engine to a windows pc, all give the same error.. and i have no clue where this SET OPTION statement came from and how can i solve it..
Any hints are appreciated!
The problem was just caused by small network timeout value while setting up mobilink parameters.
info.stream_parms = (char*) #"host=192.168.0.100;port=3309;timeout=1"
i just changed the value from timeout=1 to timeout=300 and it worked!

GAE: port_sqlite fails on local dev server

On my OS X local dev server, when I try to port an existing datastore to sqllite using port_sqlite (in combination wit use_sqlite), I get this error:
google.appengine.runtime.apiproxy_errors.ApplicationError:
ApplicationError: 3 Data in
/Users//Documents/workspace-data/datastore/.datastore is corrupt or a
different version. Try running with the --clear_datastore flag.
DatabaseError('file is encrypted or is not a database',)
The datastore works fine in the regular non-sqlite way.
What do I do? Thanks.
The clear datastore works in some cases.
I found that removing the --logs_path argument or replacing it with a new file also may help
--logs_path=/pathtologs/newfile.log
The devserver writes to the log file with logging.info(). The log entries are stored in a sqllite3 database. It is getting corrupted.
The issue I had was on the old dev server. It works properly now on the new dev server.

Understanding multiple databases in Heroku

I recently installed the heroku dev database. Then when I type into the command line heroku pg:info I get THREE databases.
=== SHARED_DATABASE (DATABASE_URL)
Data Size 808k
=== HEROKU_POSTGRESQL_BRONZE
Plan Dev
Status available
Connections 1
PG Version 9.1.3
Created 2012-05-14 17:47 UTC
Tables 0
Conn Info "host=XXXXXX.compute-1.amazonaws.com
port=5432 dbname=resourceXXXXX
user=abcXXXXX sslmode=require
password=XXXXXXXXX"
=== HEROKU_POSTGRESQL_CHARCOAL
Plan Dev
Status available
Connections 1
PG Version 9.1.3
Created 2012-05-13 19:08 UTC
Tables 0
Conn Info "host=XXXXXXX.compute-1.amazonaws.com
port=5432 dbname=resourceXXXXX
user=YYYYYY sslmode=require
password=XXXXXXXXXXXXXXXX"
=== HEROKU_POSTGRESQL_GREEN
Plan Dev
Status available
Connections 1
PG Version 9.1.3
Created 2012-05-13 19:06 UTC
Tables 0
Conn Info "host=XXXXXXXXXXXX.compute-1.amazonaws.com
port=5432 dbname=resourceXXXXXX
user=XXXXXXXXXX sslmode=require
password=XXXXXXXXXXXXXX"
The host, resource, user, and password are different for each.
Why are there three? What's the difference between them?
With the dev plan similar to the production plan you are able to add multiple databases. Each of these is a unique database and you can connect to each of them individually.
If you wished to remove a database if you did not intend to add three you could:
heroku addons:remove HEROKU_POSTGRESQL_GREEN
To promote one of those to your primary database you may:
heroku pg:promote HEROKU_POSTGRESQL_GREEN
You may also connect to each of them individually:
heroku pg:psql HEROKU_POSTGRESQL_RED
If you install the add-on multiple times it creates multiple entries. I deleted the app and readded the addon and now there is only one entry. I guess previously, I inadvertently added the addon multiple times.

Resources