Heroku db:push silently hangs on remote connection - database

I'm trying to get spree deployed onto Heroku, but using heroku db:push is failing. There are no error messages and I don't know where it would keep logs of this: There's no information at the heroku logs. Taps just asks if I want to confirm the action and then nothing. Blackness, for hours. I one time got it to spit out a "SequelConnectionError - Interrupt" after cancelling the task in Git bash. I've been looking for days on the search engines and heroku support without success. Seems like it's finding my local stuff just fine, but hangs off into an infinite loop when trying to connect remotely. I looked in wireshark but couldn't see anything out of the ordinary, though there was lots of noise.
Wondering if:
Anyone knows where taps/sequel/heroku task would keep logs? 'heroku logs' was dry of any attempts to push database.
If this is a recent error? I tried rolling taps back but some dependency wanted it at newest version.
Thanks,
Cameorn Carroll

Related

Do i need to stop my localhost server when pushing, pulling or merging code to/from github repository?

I have two terminals open in VS Code for React development. One for running the server and one for running bash commands. Now i've been told this is a bad practise as it creates problems in the build of the project. If you want to commit, pull, push, merge you should stop the server and perform these actions and then restart server. Stopping/Restarting the server takes time and seems like a hassle to me. If anyone could answer that thanks
Largely speaking, this should be fine. Assuming you are using some kind of development server (which is monitoring files for changes), any changes that are applied because of a git pull/merge/etc will cause your app to reload (usually in some optimised way).
AN exception to this can be if files that configure the development server change, as it has probably read its configuration on start and thus those changes might not take effect.
Another exception is adding/changing dependencies. If some new/different packages were added to your package.json, then you'd need to rerun npm install again before starting the development server again.
Pushing code to git while the server is running is not problematic either.
So in summary, it's usually fine to do this and is not destructive in any way. If something unpredictable happens, try restarting the dev server (and possible rerunning npm install).

Logging Errors in GCloud

Im writing a project using python hosted on a local Django server.
This same project is also deployed to GCloud where it's hosted on Google's Cloud server.
But every time it has any issues post-deployment, the GCloud's logging is always a hassle, mainly because its very uninformative.
When I run my project on my local machine, using the 'runserver' command in the command prompt, anytime an issue pops up, I'm able to view it through the command prompt (eg. django.db.utils.IntegrityError at line abc, method xyz )
Is there anything on GCloud that can give me logging akin to that? Especially if its an issue that has happened awhile back? Preferably something that is within the free trial, if possible?
Cause the best thing I could find was the Log Viewer on the project dashboard and the details it gives me is pretty scarce, something along these lines
error: 500
source: /app/submit/
resource.type="gae_app"
resource.labels.module_id="default"
resource.labels.version_id="20201117t191425"
logName=(...)
jsonPayload.trace="5ec93d7a13aac6b28fe5a8134db1691b"
It does not actually explain what causes the Error 500, as well as the details of the error.
And the documentation itself can sometimes have abit too much self-promoting and alot of linkings to broad topics that may(usually not) give me what I can use.

Google App Engine Error: DNS lookup failed for URL: http://metadata.google.internal

I've been working on a small Google App Engine (standard environment) project that uses Cloud Endpoints v2. My code is largely based on the quickstart provided by Google.
Everything was working fine, but I re-deployed today after having not looked at it for a few weeks, and I'm getting the following error when I attempt to call the endpoint:
error: An error occured while connecting to the server: DNS lookup failed for URL: metadata.google.internal
This wasn't happening before. It seems to be happening when the endpoints package is being imported by Python.
My endpoint doesn't do anything fancy - I haven't changed the source from the sample EchoApi. The error ends up in the GCP Logging console no matter if I try to access the API through the API Explorer or via Curl.
I don't get any errors during deployment.
Edit #1
Some further information:
The error originates from within Google's code that is included with the google-endpoints package which I've included in my lib folder, per
the documentation. Specifically, the error occurs on line 54 of google/api/control/wsgi.py.
Basically, it's making a request to metadata.google.internal using urllib2.
I'm guessing this address is only available from within the Google Cloud, and that for whatever reason, the instance that's hosting my app can't do a DNS lookup on it.
Edit: #2
Dug a bit further.
It seems that the error originates in the google-endpoints-api-management package. Changes committed to that package on October 19th seem to have introduced additional platform reporting. metadata.google.internal is queried to check if the code is running within the Google Container Engine, then it blows up, because the metadata address doesn't resolve.
Here's the commit:
https://github.com/cloudendpoints/endpoints-management-python/commit/0a37d0e443091053ed03e455e06d3a0ae770999f
The google-endpoints package only requires google-endpoints-api-management >=1.0.0b1. On my end, things were working fine on version 1.0.0b2, but then I built a new lib folder, which brought down 1.0.0b5, and things went sideways. Required packages haven't changed between b2 and b5, so I'm thinking I may be able to just downgrade back to b2 for the time being. Haven't tried it yet.
Sent the Google Dev an email. Perhaps he'll chime in with further tips.
Edit: 2016-11-07
Tested downgrading the google-endpoints-api-management package to 1.0.0b2. Seems to be working, kludgy a fix as it is. If you're using the lib folder, the following will scrub the newer error-prone wsgi.py file and put back the older one:
pip install -t lib google-endpoints-api-management==1.0.0b2 --upgrade
Not pretty, but it may just get you back in business.
On a side note, the Google engineer promptly replied saying that he would take a look at this issue soon. With luck, endpoints v2 will eventually come out of beta, 'cause I'm really liking it so far.
This will be fixed in an upcoming patch to the google-endpoints-api-management package (which will be 1.0.0b6). It will probably be released sometime on Monday, 11/6.
If you'd like to continue testing right away and this error is blocking you, you can go back to 1.0.0b4 until 1.0.0b6 comes out. Everything should still work as normal with that version.
Thanks for bringing this to our attention! We're doing our best to iron out all of these wrinkles now during beta in preparation for our first general release.
EDIT: 1.0.0b6 has been released and resolves this issue. Thanks for your patience during our beta phase!
(Posted solution on behalf of the OP).
Google has released version 1.0.0b6 of the google-endpoints-api-management package to address this issue. It solved the problem for me. For anyone who is encountering this problem, clean out your lib folder and re-install the google-endpoints package. This will bring down the new google-endpoints-api-management package with it.
Thanks to Brad at Google for really quick action on this.

Amazon ElasticBeanstalk Log File

I have recently deployed an ASP.net web server (together with an Database in RDS) into Amazon AWS, and I am facing some erros during a sql query execution. (SqlException)
I would like to be able to print those erros into a log file, which I have not been able to do yet. There is one log file in the Amazon Beanstalk dashboard, I have made many attempts, but my strings never show up there:
I have tried with Console.WriteLine()
Does anyone know some way to print strings into that log file? Or some other way to debug?
In order to see your messages in the log, you first need to log them.
Console.WriteLine() does not write messages into the log but it only prints them in the standard output. You must use some logging framework for this purpose.
Elmah is one option, for example.
Also, it might be useful to read some logging tutorials for APS net: this one seems to cover a lot of use cases.

Database locked in Google App Engine

I was running two different versions of my app with the same api_version number, and I started receiving Database locked exception. I've closed both apps, removed both from the app engine launcher, and then reloaded the one i'm currently working on; and I'm still getting the same error.
I've been googling it for 30 minutes, and it doesn't seem like there is a lot of information on this topic specifically related to GAE.
I would like to know how to go about fixing the issue, but more than that, I'd like to know what's causing it in the first place.
I gave to 2 api versions different version numbers but the same api number with the hope that I'd be able to run them concurrently and have them share a datastore instance, but if its displaying this behavior locally, I'm sure its not going to work when deployed. I suppose I have less of an understanding of the versioning than I thought. If anyone has a brief explanation of that process, what causes locking and how to fix that would be great. Thanks!
EDIT:
'api_version' refers to google's api for app engine; nothing to do with one's personal application. still trying to figure out how to deal with 'version' and #endpoints.api. What's the diff?

Resources