It used to work for me following this tutorial. Stopped working for a couple days, worked again, and now completely stopped working. I desperately need a program to help me manage my CloudSQL database and have tried multiple times following multiple tutorials and multiple setups with phpMyAdmin with no luck. I then tried phpMiniAdmin, SQL Buddy, and Adminer. I also tried this tutorial with no luck. To be clear, I am able to access the database using the following code in my own php scripts,
new mysqli('localhost','<username>','<password>','<db>',0,'/cloudsql/<app-id>:db');
It seems like the main problem is something to do with "socket" vs "host" in the Google App Engine setup. My "app.yaml" matches the tutorial, excluding references to my app, and my "config.inc.php" is the following,
<?php
$cfg['blowfish_secret'] = '<#>';
$i = 0;
$host = '/cloudsql/<app-id>:db';
$type = 'socket';
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['socket'] = $host;
$cfg['Servers'][$i]['connect_type'] = $type;
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['McryptDisableWarning'] = true;
$cfg['PmaNoRelation_DisableWarning'] = true;
$cfg['ExecTimeLimit'] = 60;
$cfg['CheckConfigurationPermissions'] = false;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
I'm currently using 4.0.10, but tried 4.1.7 with the same results. I am greeted by a blank screen,there is source code but screen is blank. In the Apps Engine error logs I don't have any errors, just warnings referencing the inability to find images,
Static file referenced by handler not found: phpMyAdmin/pma_logo.png
I would love to know if anyone is currently using phpMyAdmin or any other php software to access CloudSQL, if so, maybe they might have a tip or two as to what is going on. I'm willing to share anything relevant as well, just let me know what and I'll post it.
EDIT: Got it working. I'm not sure why it initially stopped worked, started working, and then stopped working again. During my trails and error trying to get it to work I started using different tools including Codenvy as opposed to the Google Apps Engine client for Windows. I went back to using the GAE Windows client and was finally successful in accessing phpMyAdmin in CloudSQL. I don't know for sure, but I suppose it's possible the reason I struggled with strange errors during some of my testing could have been related to using Codenvy as opposed to Google's own tools. I'm not saing Codenvy was the problem, just that if a person is having phpMyAdmin/CloudSQL issues, they might consider trying the GAE client before pulling all their hair out.
The problem seemed to resolve itself. It's possible Google was doing some maintenance, I have no other explanation.
Related
I know this issue has been treated before since I have googled and read most of the responses of people who have had the same or similar problem in the past. None of them have been the solution for my case. The problem I have is my client method is not getting called and I have already defined the client method before starting the hub. When I do that I get another error but when I define the method after starting my hub, I don't get an error but then my client function does not get fired.
I think, the fact that I am self-hosting in a Win service using static files serving or because I am using AngularJS, that's why I am having this problem. but I am not really sure.
Can you help me? Any suggestions? Of course I have gone through the SignalR troubleshooting guide several times. I have checked the name of my client method to make sure all is correctly named but still this problems rears it head. I would like to believe the fact that its because I am self hosting or because of Angular . I know that when I define my client method before starting the hub, the hub tries to setup subscriptions to the signal service and when it tries to do so fails because it cannot find (my assumption) the hub which is defined (Hub name: OffiHub) in a folder (/OffiSignalR/Hubs).
I get the following error when I debug using Chrome: jquery-2.2.1.js:9175 GET http://localhost:36900/OffiG/start?transport=serverSentEvents&clientPD%3D&connectionData=%5B%7B%22name%22%3A%22offihub%22%7D%5D&_=1459195567970 500 (Internal Server Error)
In case you wish to see my code, here it is:
var offiHub = $.connection.offiHub;
offiHub.client.publishSales = function (so) {
//Add to the current list.
console.log("We got here!");
log('We got here, hurray!.');
};
$.connection.hub.start().done(init);
I have found the answer to my problem. It was all my fault, I had a code snippet in the OnConnected method on the server which was failing when I try to connect to the service from the client. I had placed the code there for when I would need it but hadn't thought much about it. This code has given me much grief these past few days. Remove it and all is working well from all clients. In fact it was the .Net client that made me suspect the faulty code.
I am using play framework 1.2.7, gae module 1.6.0 and siena module 2.0.7 (also tested 2.0.6). This is a simple project that should run in play deployed on App Engine and connect to a MySQL database in Google Cloud SQL. My project runs fine locally but fails to connect to the database in production. Looking at the logs it looks like it is using the postgresql driver instead of the mysql one.
Application.conf
# db=mem
db.url=jdbc:google:mysql://PROJECT_ID:sienatest/sienatest
db.driver=com.mysql.jdbc.GoogleDriver
db.user=root
db.pass=root
This is the crash stack trace
play.Logger niceThrowable: Cannot connected to the database : null
java.lang.NullPointerException
at com.google.appengine.runtime.Request.process-a3b6145d1dbbd04d(Request.java)
at java.util.Hashtable.put(Hashtable.java:432)
at java.util.Properties.setProperty(Properties.java:161)
at org.postgresql.Driver.loadDefaultProperties(Driver.java:121)
at org.postgresql.Driver.access$000(Driver.java:47)
at org.postgresql.Driver$1.run(Driver.java:88)
at java.security.AccessController.doPrivileged(AccessController.java:63)
at org.postgresql.Driver.getDefaultProperties(Driver.java:85)
at org.postgresql.Driver.connect(Driver.java:231)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at play.modules.siena.GoogleSqlDBPlugin.onApplicationStart(GoogleSqlDBPlugin.java:103)
at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:525)
at play.Play.start(Play.java:533)
at play.Play.init(Play.java:305)
What is going on here? I am specifying the correct driver and url schema and it's using postgresql driver. Google Cloud SQL API access is enabled, the app is allowed to connect to the mysql instance, I am not using db=mem, ... I am stuck and can't figure out how to move forward! :-((
UPDATE: I thought I found the solution, but that was not the case. If I keep the %prod. prefix and create a war normally (or just don't define any DB properties), then the application will use Google DataStore instead of the Cloud SQL. If I create the war file adding --%prod at the end (or just delete the %prod. prefix in the application.conf), then it will keep failing to connect to the database showing the same initial error.
Any ideas please?
After being stuck for so long on this I just found the solution in no time after posting the question. Quite stupid actually.
The production environment properties in the application.conf file must be preceded by %prod. so the database config should read
%prod.db.url=jdbc:google:mysql://PROJECT_ID:sienatest/sienatest
%prod.db.driver=com.mysql.jdbc.GoogleDriver
%prod.db.user=root
%prod.db.pass=root
And everything runs fine.
EDIT: This is NOT the solution. The problem went away, but the app is using the DataStore instead of the Cloud SQL
At the end I ended doing a slight modification in play siena module source code and recompiling it.
In case anyone is interested, you will need to remove/comment/catch exception in this code around line 97 in GoogleSqlDBPlugin class:
// Try the connection
Connection fake = null;
try {
if (p.getProperty("db.user") == null) {
fake = DriverManager.getConnection(p.getProperty("db.url"));
} else {
fake = DriverManager.getConnection(p.getProperty("db.url"), p.getProperty("db.user"), p.getProperty("db.pass"));
}
} finally {
if (fake != null) {
fake.close();
}
}
For some reason the connection fails when initiated with DriverManager.getConnection() but it works when initiated with basicDatasource.getConnection(); which apparently is the way used by the module in the rest of the code. So if you delete the above block, and recompile the module everything will work as expected. If you are compiling with JDK 7, you will also need to implement public Logger getParentLogger() throws SQLFeatureNotSupportedException in the ProxyDriver inner class at the end of GoogleSqlDBPlugin file.
Strangely, I digged into the DriverManager.getConnection() and it looked like some postgresql driver is registered somehow, because otherwise I can't see why DriverManager.getConnection() would call to org.postgresql.Driver.connect().
Well, I'm having a weird error here:
I'm developing one GAE app to read some Twitter Data, and after read a lot of docs, I have it working on my test server (Running on my pc) but after deploy and test on the real (my appspot domain) it shows this message:
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or >incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the >system clock is in sync.
message - Could not authenticate you
code - 32
I've tried to recreate my OAuthAppToken and OAuthAppTokenSecret keys, even changing the permissions to "Write, Read and Direct Messages" and even assingning one Callback URL but nothing seems to work...
I've tried using twitter4j.properties OR using setOAuthConsumer(TW_CONSUMER_KEY, TW_CONSUMER_SECRET) OR a ConfigurationBuilder whith the correct constants and I'm experimenting the same Issue.
I'm working with AppEngine 1.8.3 and Twitter4j 3.0.4
Iv'e been writing on log and the Twitter object seems to be well created... I dont understand why is working on my PC but not on the real app.
On some other post someone says that could be because it needs to use Sync clock.. but he doesn't explains where to change that property...
Did someone had a clue?
Ok, the problem was me (and Twitter.... well..... I really think it was Twitter problem for being so dark on his api messages)...
On testing server I was looking for an existing account and on the cloud I was looking for an inexistent one. So, It was my mistake. But seriously, what about Twitter saying: "Access Forbidden"? That doesn't have any sense...
I have this site, a random little one i just play around on with jsf and primefaces.
I have my own domain connected to it, and hosted it on google-app-engine...
It's been working as a charm right up until now. I have not done anything on the site due to vacation time, and suddenly the site is down? It was working when i deployed the last time, now when i go to my site i get this:
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
It tells me absolutely nothing, i've tried to re deploy my app, after checking that it worked fine running locally. The first couple of time it just kept on waiting for a verify.. So i stopped it, which led me to learn how to do a rollback as i could not redeploy with the same version number after i stopped it the first time.
I got the rollback fixed, and i now deployed what i know i working code to the app-engine, and still when navigating to my site i get the above error? :S
I'm totally clueless here as the error doesn't really give me anything :S
Anyone have any ideas, i can post code etc. if necessary but something tells me that it is something else seeing that my code runs locally, and ran fine deployed too :S
You can find the log file for your web application at
https://appengine.google.com/logs?&app_id=yourappname
or on the Dashboard page in the list on the left side.
If you deploy a new version, also re-start the browser to clear old session data.
(Maybe you still get the 500 error still because of old session data).
Okay so I'm having some annoying issue here. I am clearly missing something, and already been frustrating myself with this for the last 4-5 hours.
I cannot seem to be able to create a simple GAE+Jersey up and running with IntelliJ.
The frustrating part is that I do not get any errors, just that the REST service is not present after deployment.
I've tried out a few basic stuff, basically everything you can find on Google (and here).
After some frustration I've downloaded this project: https://github.com/BluerockInteractive/GAE-Jersey-Guice-Sample
Just cause this will list out the available servers, plus the deeper logging level.
Now here's the output of the AppEngine startup:
https://docs.google.com/open?id=0B42XvjSlpDCtTTdwQl9MSTBlQ0U
So my problem: The AppEngine is up and running. If I create a basic servlet everyting works fine. However, I cannot get Jersey to work. In every form I could try it always throws an
HTTP ERROR 404
Problem accessing /jerseyguicesample. Reason:
NOT_FOUND
Powered by Jetty://
Any ideas, what I could be missing here?
Here's an image of the IDE and the artifact settings: http://img51.imageshack.us/img51/7913/20120428124133.png
Thanks, :D
This example has REST handlers mapped to /rest/test, /rest/players/{name}/xml, /rest/players/{name}/json and /rest/hello.
What (and where) did you map /jerseyguicesample to?