I messed up with my database and would like to do a rollback. Since I am using Heroku Postgress Hobby Basic plan which doesn't support automatic backups, there is no any backup which I can restore to.
heroku pg:backups --app heroku-app-name
This command gives me following result:
=== Backups
No backups. Capture one with heroku pg:backups:capture
=== Restores
No restores found. Use heroku pg:backups:restore to restore a backup
=== Copies
ID Started at Status Size From To
──── ─────────────────── ───────────────────────────── ────── ───────── ─────────
c002 2022-06-09 18:53:16 Completed 2022-06-09 18:53:39 3.12MB From Name Target Na
c001 2020-05-27 21:47:47 Completed 2020-05-27 21:48:13 3.12MB DATABASE BLUE
I would like to know what are these Copies, specifically what does the copy c002 stand for, does it contain any data and if it can downloaded/used as some kind of a backup.
Related
The logs around the error is this below. It used to work but after a few days ago, this start failing. I didn't not change deploy flow.
The only change is that we started to pay. Before that we used it as a trial member.
Though I don't think that is the cause...
Does anyone know how to get over this error?
Using app from: /Users/vagrant/deploy/app-production-[REDACTED]-bitrise-signed.apk
Configuration read successfully
Authenticating
Authenticated client created
Create new edit
editID: xxxxxxx
Edit insert created
Upload apks or app bundles
Uploading /Users/vagrant/deploy/app-production-[REDACTED]-bitrise-signed.apk 1/1
Uploaded apk version: 36
Done uploading of 1 apps
New version codes to upload: 36
Applications uploaded
Update track
Release version codes are: [36]
alpha track will be updated.
updated track: alpha
Track updated
Committing edit
Failed to commit edit, error: googleapi: Error 403: You cannot rollout this [REDACTED] because it does not allow any existing users to upgrade to the newly added APKs., forbidden
| |
+---+---------------------------------------------------------------+----------+
| x | google-play-deploy#3.6 (exit code: 1) | 19.44 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-google-play-deploy/issues |
| Source: https://github.com/bitrise-io/steps-google-play-deploy |
+---+---------------------------------------------------------------+----------+
I had some ruby code in a ruby script that connected to a mysql DB. When I connected I then did a MySQL2.query("BEGIN") to start a transaction and if I wanted to rollback I did MySQL2.query("ROLLBACK") or if all was well and I wanted to commit I did MySQL2.query("COMMIT").
I have now moved to a postgres database and while the PG.exec("BEGIN"), PG.exec("ROLLBACK") and PG.exec("COMMIT") do not seem to error I do get a warning 'there is no transaction in progress' when I commit so it seems it is doing auto commit (i.e. committing each SQL INSERT/UPDATE as it is done). Basically I want to be able to manually rollback or commit.
I think maybe I need to turn autocommit off but cant work out how, I tried #dbase.exec('SET AUTOCOMMIT TO OFF') but got the error 'lib/database.rb:28:in `exec': ERROR: unrecognized configuration parameter "autocommit" (PG::UndefinedObject)'.
Ive done a fair amount of googling without any luck;(.
I am using postgres 9.5 and ruby 2.4.1.
PostgreSQL does not have a setting to disable autocommit:
https://stackoverflow.com/a/17936997/3323777
You just should use BEGIN/COMMIT/ROLLBACK.
BTW which adapter gem do you use? PG.exec syntax seems strange.
Consider the following snippet (pg 0.20 used):
conn = PGconn.open(:dbname => 'database', user: "user", password: "...")
conn.exec("DELETE FROM setting_entries")
conn.exec("INSERT INTO setting_entries(name) VALUES ('1')")
conn.exec("BEGIN")
conn.exec("DELETE FROM setting_entries")
conn.exec("INSERT INTO setting_entries(name) VALUES ('1')")
conn.exec("ROLLBACK")
And this is the postgre log:
(0-22/70) 2017-08-31 12:37:12 MSK [19945-1] user#database LOG: statement: DELETE FROM setting_entries
(0-22/71) 2017-08-31 12:37:12 MSK [19945-2] user#database LOG: statement: INSERT INTO setting_entries(name) VALUES ('1')
(0-22/72) 2017-08-31 12:37:12 MSK [19945-3] user#database LOG: statement: DELETE FROM setting_entries
(5948637-22/72) 2017-08-31 12:37:12 MSK [19945-4] user#database LOG: statement: INSERT INTO setting_entries(name) VALUES ('1')
As you can see, the transaction ids are the same (/72) for the last two lines.
To be sure you could write a unit test where you would make two updates within a transaction, rollback them and see if both would roll back.
I follow the basic installation tutorial on for the mean stack on OS X.
MongoDB is running and all dependencies are believed to be installed.
During init of my first app, the script fails when asking for the admin user password (it fails before I am allowed to input anything as my admin password):
$ mean init myApp
? What would you name your mean app? myApp
? The Mean project is currently in developer preview. To help improve the -
quality of this product, we collect anonymized data on how the mean-cli is used -
You may choose to opt out of this collection now (by choosing 'N' at the below prompt)
or at any time in the future by running the following command:
mean disable user-reporting
Do you want to help us improve the mean network (Y/n)? Y
? Please provide your email so we can create your first admin user: joe#doe.com
? Please provide your username so we can create your first admin user: admin
Cloning branch: master into destination folder: myApp
git clone --depth 1 -bmaster https://github.com/linnovate/mean.git "myApp"
Cloning into 'myApp'...
##############################################################
#
# !!! MONGOOSE WARNING !!!
#
# This is an UNSTABLE release of Mongoose.
# Unstable releases are available for preview/testing only.
# DO NOT run this in production.
#
##############################################################
DB connection successful!
Please provide password so we can create your first admin user
prompt: password: /usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
TypeError: Cannot read property 'length' of undefined
at processResults (/usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1581:31)
at /usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1619:20
at /usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1157:7
at /usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1890:9
at Server.Base._callHandler (/usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/base.js:448:41)
at /usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:481:18
at MongoReply.parseBody (/usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at null.<anonymous> (/usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:439:20)
at emit (events.js:107:17)
at null.<anonymous> (/usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13)
I am able to create users manually in the resulting app folder.
But the resulting application seems to be incomplete and I cannot start it.
$ mean user joe#doe.com --addRole admin;
Adding role `admin` to user `joe#doe.com`
##############################################################
#
# !!! MONGOOSE WARNING !!!
#
# This is an UNSTABLE release of Mongoose.
# Unstable releases are available for preview/testing only.
# DO NOT run this in production.
#
##############################################################
DB connection successful!
successfully updated
You need to install mongo database.
http://www.liquidweb.com/kb/how-to-install-mongodb-on-ubuntu-14-04/
I have been upgrading to another Visual Studio Version 2013 (Update 3) on another machine dev machine.
I then tried to create a test project in an existing collection. it crashed. Tried it three times then deleted the corrupted projects.
After that I tought. Well I should upgrade to TFS 2013 (Update 3) too. So it tried to Upgrade my existing collections. It failed for the collection with the corrupted project.
So I tought its easy just restore the database. But thats not so easy. And it tells me that I need to restore the configuration db too. In order to do so it says I need to rename the configuration db. But then I cannot start the management tool to restore ?! It freezes.
What would you suggest? I have a backup but I cannot restore it so far. And I do not understand why it tells me that I need to restore the configuration backup too. I always tought that collections are independent.
Here are some addition screenshots:
Upgrade progess problem:
Complete Screenshot:
[2014-08-07 23:30:13Z][Error] TF400744: An error occurred while executing the following script: SetRecoveryModelToSimple.sql. Failed batch starts on the line 1. Statement line: 1. Script line: 1. Error: 5069 ALTER DATABASE statement failed.
As suggested I have run the best practice analyzer.
The upgrade log is actually large. I am posting just the last lines:
"[Info #23:29:51.189]
[Info #23:29:51.189] +-+-+-+-+-| ResultsSqmData |+-+-+-+-+-
[Info #23:29:51.189] Feature: ApplicationTier (1)
[Info #23:29:51.190] Feature: ApplicationTier; previousFailure: False
[Info #23:29:51.192] Error count: 0
[Info #23:29:51.192] Warning count: 0
[Info #23:29:51.192] Overall Result: TotalSuccess (1)
[Info #23:29:51.192] WebSiteData: 9
[Info #23:29:51.192] SqlData: 8
[Info #23:29:51.193] RSData: 0
[Info #23:29:51.193] WSSData: 0
[Info #23:29:51.193] Wizard: UpgradeWizard (4)
[Info #23:29:51.193] TfsConfigData: 8194
[Info #23:29:51.197] serviceLevel: Dev12.M68
[Info #23:29:51.197] Fatal Error Location: 0
[Info #23:29:51.197] Activity = ApplicationTierUpgrade (4)
[Info #23:29:53.053] ResultSqmData.UpdateIssues
[Info #23:29:53.068] no issues
[Error #06:53:08.370] TF400744: An error occurred while executing the following script: SetRecoveryModelToSimple.sql. Failed batch starts on the line 1. Statement line: 1. Script line: 1. Error: 5069 ALTER DATABASE statement failed.
[Info #06:53:08.385] To configure the new features for a team project, follow the steps in http://go.microsoft.com/fwlink/?LinkID=229859
"
When I try to detatch it this occurs:
TF401219: The team project collection 'XXX' cannot be detached because its version ID is different than the ID for the configuration database. The collection has the following version: Dev12.M62. The Team Foundation Server is at the following version: Dev12.M68.
When I try to restore a backup this occurs:
TF400990: Database Tfs_Configuration exists on SQL instance NUBO-XXX\SqlExpress. Please drop or rename the existing database before the restore operation
First of all keep calm.
I would try to complete the upgrade before trying other options. From what you show seems you have issue at SQL level, could be a permission: check both the TFS service account and the your user.
If you want to rollback, and you used the integrated backup, you have to restore all databases in practice.
I'm completely confuse about Heroku Postgres Plan. Please help.
When I check for PG info, using:
heroku pg:info
It's showing:
=== HEROKU_POSTGRESQL_BRONZE_URL
Plan: Basic
Status: available
Connections: 1
PG Version: 9.2.4
Created: 2013-07-30 12:44 UTC
Data Size: 6.3 MB
Tables: 0
Fork/Follow: Unsupported
=== HEROKU_POSTGRESQL_MAROON_URL (DATABASE_URL)
Plan: Dev
Status: available
Connections: 4
PG Version: 9.2.4
Created: 2013-08-06 05:17 UTC
Data Size: 10.7 MB
Tables: 13
Rows: 22346/10000 (Write access revoked)
Fork/Follow: Unsupported
Here showing HEROKU_POSTGRESQL_MAROON(free) have 13 tables. But in Paid database there is no table. Isn't it means paid database is not working?
I don't want to use that free database. Please help me to find a way to inset data into my paid database not into free.
I also tried by deleting free database from heroku database console. But then it shows application error.
You need to "promote" the database you want to use.
heroku pg:promote HEROKU_POSTGRESQL_BRONZE_URL
This will set the DATABASE_URL to the corresponding database.
More info here