yesterday on our tahmeel-postgresql-prod instance there was a maintenance update https://dzwonsemrish7.cloudfront.net/items/0t253L361v411g060n26/Image%202018-10-09%20at%201.46.38%20PM.png
Thanks to that update, we started to see errors ERROR: could not access file "$libdir/postgis-2.3": No such file or directory when we tried to use postgis https://dzwonsemrish7.cloudfront.net/items/2G371k0D2j1K1J2x3q0P/Image%202018-10-09%20at%201.48.04%20PM.png
Here you can see logs from the database, problems started to arise when the maintenance started https://dzwonsemrish7.cloudfront.net/items/2g3a28171l1v3R2H2838/Image%202018-10-09%20at%201.53.09%20PM.png
so what we did was to clone the db as tahmeel-postgresql-prod-clone and switch the app to use new db.
My question is -- what happened and why?
Related
I'm trying to open my newly installed Postman when an error occurs which says something like this:
**Could not open Postman**
Error: Migration: IndexedDB schema migration failed. IndexedDb was not upgraded succesfully after `dexie.open`.
Please try restarting the app. If the issue persists, please refer to http://go.pstmn.io/troubleshoot-could-not-open
As it says, the error really persists. The website above only provides suggestions like "reinstall the app" "upgrade the app", which are not really helpful. And as I dig into the Internet, it occurs to me that such error hardly happens (found nobody have the same question like me).
"IndexedDb" was mentioned in the error message, and I just know (from the Internet) that it's a nosql database provided by explorer. Maybe the problem can be solved by reinstalling the database, I guess?
I had a similar problem and found this description: https://github.com/postmanlabs/postman-app-support/issues/4897
Short answer is, delete the Postman configs directory at ~/.config/Postman (for Linux) and then try running again. This will delete any saved Postman data you have, but for a newly-installed instance that's not an issue.
Go to installation folder of Postman:
C:\Users\Davoud\AppData\Local\Postman
delete the older version's folder. It fixed my problem. Actually I also deleted update.exe too.
Can you try just by deleting the “Postman” folder or renaming it to “Postman.old” from below two locations and then reinstall the latest version from here and see if that helps?
C:\Users\<user>\AppData\Local and C:\Users\<user>\AppData\Roaming
I tried it as I was facing the same issue and, it solved for me.
Use this: It worked for me.
pkill -fi Postman
For Windows 10 - in my case, I have to:
Open Task Manager and kill/end the Postman application.
Go to %appdata% and search the "Postman" folder.
Inside "Postman" folder, select the "Postman_Config" folder1. Delete it.
Try to open your Postman instance again.
1 The "Postman_Config" folder contained (in my case) another folder called "0" and inside this folder, an "userconfigs.json" file - which only contained these characters:
{}
If you have additional information,please, make a copy of these files in order to have a backup - if needed.
For Windows -
Kill the process that says, postman from the task manager
Run the installer again, it resolved the issue for me.
disable hardware acceleration in the Postman menu in macOS, or the Help menu in Windows or Linux.
I had a similar problem installing Postman when I was on a VPN (on Windows). It started up but then got a popup error saying "TypeError: Cannot read property 'id' of undefined," and a blank white screen afterwards. So I uninstalled it, deleted any Postman folders, turned off the VPN, and re-installed it with no problems! After it installed successfully, I was able to turn on my VPN and had no further issues.
For reference, I had these errors in my C:\Users\<user>\AppData\Roaming\Postman\logs\renderer-requester.log file
[20076][1645655031650][requester][info]["Migrations: Committing IndexedDB upgrade"]
[20076][1645655031665][requester][error]["Could not complete migration.",{"name":"Error","message":"Migration: IndexedDB schema migration failed. IndexedDb was not upgraded successfully after `dexie.open`.","stack":"Error: Migration: IndexedDB schema migration failed. IndexedDb was not upgraded successfully after `dexie.open`.\n at file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:477:1448541\n at file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:3000934\n at Ve (file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:2996146)\n at ze (file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:2996903)\n at IDBOpenDBRequest.<anonymous> (file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:2997272)"},{"0000_initial":"started","0001_add_archived_resources_table":"started","0002_add_variable_sessions_table":"started","0003_add_editor_tables":"started"}]
[20076][1645655031673][requester][error]["Migration: Could not complete migration.",{"name":"Error","message":"Migration: IndexedDB schema migration failed. IndexedDb was not upgraded successfully after `dexie.open`.","stack":"Error: Migration: IndexedDB schema migration failed. IndexedDb was not upgraded successfully after `dexie.open`.\n at file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:477:1448541\n at file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:3000934\n at Ve (file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:2996146)\n at ze (file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:2996903)\n at IDBOpenDBRequest.<anonymous> (file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:2:2997272)"},{"0000_initial":"started","0001_add_archived_resources_table":"started","0002_add_variable_sessions_table":"started","0003_add_editor_tables":"started"}]
[20076][1645655031676][requester][info]["booted - requester"]
[20076][1645655031686][requester][error]["Could not complete migration.",{"name":"TypeError","message":"Cannot read property 'id' of undefined","stack":"TypeError: Cannot read property 'id' of undefined\n at t.default (file:///C:/Users/<user>/AppData/Local/Postman/app-9.13.0/resources/app.asar/js/scratchpad/scratchpad.js:477:1193039)\n at
......
I have a Django 1.9-driven website run on Ubuntu, and I very often face a strange issue that some error vanishes when I run the clone of the project locally from my PC using 127.0.0.1:8000 url. Locating the error in such cases is EXTREMELY time consuming and I wonder what are the best practices for debugging a large-scale project, especially when the website is already partially in use.
Just to be as specific as possible, I provide a step-by-step description of what goes wrong.
Step 1. I type some url, say, 10.8.0.1:8000/show_students/
Step 2. Do some action on the page, say, save a student profile. The operation does not end successfully, yielding an error.
Step 3. I copy-paste the project directory located on the remote server onto a local directory on my PC and try to run the CLONE. I see that the error does not take place.
Real-life example,
task_email_recipients = TaskEmailRecipients.objects.get(task_type =
task_instance.type, legal_entity_own = legal_entity_own_instance)
This line throws exception saying that LegalEntityOwn has no field named (yes, I did not omit anything. It is empty string after "field named")
If I run the same view from 127.0.0.1, the error goes away.
What should be my actions ?
BTW, I use Eclipse if this makes any difference. And I have MS Windows 10 on my local PC.
Summing up, my goal is to debug the project run from 10.8.0.1
UPDATE for – Paul Becotte's comment
I've always ignored this warning, but when running the project, it gives a warning
You have unapplied migrations; your app may not work properly until
they are applied. Run 'python manage.py migrate' to apply them.
So, let me explain a few concepts.
A. Source Control (Git) lets you keep track of all the changes to your source code. This is pretty important so that you can feel confident that you are running the same version of your code on your development machine as your deployed server without trying to do something like copy the files back and forth. A command like git status can show you if you changed something and maybe give you tips on what is different between the two environments. If you are not using git, you should immediately start!
B. Migrations are like source control for the schema of your database. A SQL database like Mysql or Postgres has a fixed schema- you have THIS many tables, with THESE names, and table A has three columns with one of them called Name and one called ID and so forth. Migrations are designed to give you visibility into what these schema are- instead of logging into the database and running CREATE TABLE A ... you build a migration file that contains the necessary commands, and then stamps the database with a version number. Then you run those command files so that if the databases are on the same version, you know they have the same structure (which allows you to get your local database to match your deployed one). Django has a helpful migration system all built in... manage.py migrate is a command to apply all of the migration files to the current database. If you are getting the error message you listed, there is basically no chance that your app IS going to work properly, because your database schema, somewhere, is out of sync with your model files. Based on your very limited description, you added a field to a model that now exists in your local database but does not exist in your production database.
C. I mentioned a deploy script- this is a single command you can run to get your code running on your remote server so that you are sure it happens the same way every time. In this case it might be something like...
ssh production
git pull
python manage.py migrate
uwsgi
Set up a script like that so that you know what is going on, and you can rule out accidentally skipping steps as an error vector.
I built a (relatively simple) Django project following a tutorial (the recently released Hello Web App book.) I committed my changes along each step of the way, and I have my working solution in a github repo. However, when I clone the code into a new work space such as onto a new machine or into a new slot on a cloud IDE, the app doesn't work. I get a few errors and with each I resolve, another pops up. Basically, my environment is totally messed up and incompatible with the app beyond having Python and Django both installed.
I realize that I can read through the error messages I get when I invoke runserver, solve each one by one, etc. but it seems there should be a cleaner/simpler way to be able to pull down my repo to a fresh workspace and have it up and running in just a minute or two. I've read recommendations about using virtualenv, but it also seems like people discourage including venv inside your repo because of the extraneous commits and added bulk that will result from it so I don't think that actually solves my problem of trying to reduce new workspace configuration effort.
Perhaps I am overly optimistic, but I'm hoping someone can give me a recommendation to avoid the need to workout these kinks each time I start fresh.
I'm trying to develop a Django website with Heroku. Having no previous experience with databases (except the sqlite3 one from the tutorial), it seems to me a good idea to have the following file structure:
Projects
'-MySite
|-MySite
'-MyDB
I'm finding it hard to figure out how to do it, with psql commands preferring to put the databases in some obscure directory instead. Perhaps it's not such a good idea?
Eventually I want to be able to test and develop my site (it'll be just a blog for a while, I'm still learning) locally (ie. add a post, play with the CSS) and sync with the Heroku repository, but I also want to be able to add posts via the website itself occasionally.
The underlying data files (MyDb) has nothing to do with your project files and should not be under your project.
EDIT
added two ways to sync your local database with the database ON the Heroku server
1) export-import
This is the most simple way, do the following steps every now and then:
make an export on the Heroku server by using the pg_dump utility
download the dump file
import the dump into your local database by using the psql utility
2) replication
A more sophisticated way for keeping your local db in sync all the time is Replication. It is used in professional environments and it is probably an overkill for you at the moment. You can read more about it here: http://www.postgresql.org/docs/9.1/static/high-availability.html
During development, I like the idea of frameworks like Entity Framework 4.3 Migrations (although I need it to work with sql scripts instead of Migration classes) keeping all developer databases up-to-date. Someone does an update to get the latest source, they try to run the application and get an error that they need to update their database to the latest migration (or have the migration happen automatically). Migration files are timestamped so devs don't have to worry about naming two files the same or the sequence the files need to be executed in.
When I get ready to build a WebDeploy deployment package, I want the package to contain the scripts required to move the production database to the latest db version. So somehow, MSBuild or WebDeploy need to make a decision about which scripts must be packaged. For deployment I don't want the application to try to update itself like what EF offers. I want to either hand the package to the IT department or do an auto-deploy through a deployment server.
Some of my questions are:
Can EF 4.3 work with sql scripts instead of DBMigration classes for my development needs (I'm already using it for my ORM so it would be nice if it could)?
Does MSBuild or WebDeploy understand the concept of database migrations (e.g. does it recognize the EF. 4.3 migrationHistory table) or do I have to make sure to give it just the scripts it needs to run that will bring my prod db to the latest migration? Manually deciding which scripts should be pakaged is not something I want to do so is there a MS WebDeploy extension that understands migrations?
Are my concerns and ideas valid? I'm just researching this stuff so I don't really know.
I think that your concerns are valid. During development anything that keeps the developer machines in sync will do. When deploying, more control is needed.
In my project we've decided to only use code-based migrations, to ensure that all databases are migrated in the same order with the same steps. Automatic migration and db creation is disabled by a custom initialization strategy that only checks that the db exists and is valid.
I've written more about the details in Prevent EF Migrations from Creating or Changing the Database. I've also looked a bit into merge conflicts which will eventually happen with multiple developers.
You can run SQL in the classes by calling the Sql method, or generate SQL from a migration by using the -script parameter with the update-database command.
No. They were looking at adding support for webdeploy but apparently decided against it before rtm. They did however release a command line app (and powershell script obviously) which you could call from either.
What I do in my projects is create an startup module in my applications and run any migrations that haven't been deployed automatically - Triggering EF migration at application startup by code. It's not perfect, developers have to run the app after getting latest before changing the db, but it works for both get latest and deployment.