gatling- am I doing it right? - gatling

I am new to gatling and I just want to know if I am doing it right. Here is the scenario.
I am running an application on my local instance, created a simple gatling test to login (with specific credentials), answer a survey(has a specific id) and logout. I have 'testdb' loaded for this app. I run the test, it gives me the result- everything is fine and perfect.
Now I change the testdb to proddb. Note that login creds will be different. so if I run the same test on this new one, I see a few 401 and remotely closed exceptions; but the login part of the test works fine (which as per my understanding should fail- since they are not the old creds). this in the reports shows up as a passed test. How could this happen? Please help. Any explanation as to what is happening and where am I doing wrong will be gladly taken.
Thank you!

Related

CloudSQL suddenly changes root password

So just recently I started using CloudSQL with an AppEngine instance. I got it working fine. The only thing it did was have one call that stored stuff in a table and one that outputted the content of the table.
All the suddenly when I accesed the page that should output the content of the table it said:
Sorry, unexpected error: (1045, "Access denied for user 'root'#'localhost' (using password: NO)")
I couldn't understand what I did wrong, so what I did was to login, change the password for root#localhost to empty (as it can only be accessed from the GAE anyway) and it started working again, so ofcourse I thought it was my mistake.
The same thing is happening over and over again, makes it impossible to do anything. I set the password for root#localhost to empty, it works, then after a while it stops working.
The AppEngine Instance is in the same project as the CloudSQL DB and I connect to it over a unix socket (using Python, exactly as the example code does). And it works for a while but for some reason stops working after a while.
What am I doing wrong or is it just buggy?
Thanks!
Make sure you run FLUSH PRIVILEGES after you change the password.

Openshift: Uploading File not possible / Sending emails not possible

I have a small web project where I use openshift as a service for a test system.
Now I got 2 problems:
1) I have a form in which a user shall upload a picture. For that I use multipartfile. But the file upload just doesn't work, while it does locally under dev.
So now I ask myself if I need to configure something on the server. But I couldn't find out what (and why).
2) I am sending emails after a certain action. Which again runs perfectly fine under development, but not using my test system on openshift. If I remember correctly it was a 415 error, I have to repeat the test at home to look it up.
I can't give more information right now as I'm not yet home, but I don't think that much code is needed as it all works fine testing it locally.
I post this question rather for a quick answer like "uuh yeah, for openshift applications you need to configure it first for doing those things: here and there, make this and that and read here" which I oversaw.
I hope someone can give me some hints, I don't get why it all works locally but not on a test system.
Quick Answer:
Make sure your file uploads are being sent to your $OPENSHIFT_DATA_DIR and for email check out this post https://www.openshift.com/forums/openshift/send-mail-through-openshift-using-gmail or use something like SendGrid which is free in the OpenShift Marketplace.
If those don't help, posting some application logs will be really helpful

Problems using Twitter4j on GAE throws 401 just after deploy

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...

Google-app-engine Server: Error 500 on working code - deployment problems. Java code

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).

CakePHP's Auth->Login not working in production, but works in test

I have a CakePHP website that's been working great.
I just developed a new functionality that at one point auto-logs the user in, and redirects him to a page that's behind the login wall.
This works perfectly well in my dev machine, but in production, the user gets redirected to the login page.
Relevant code: (not much)
$objCustomer = $this->Customer->findById($customerId);
$this->Auth->login($objCustomer);
$this->redirect("/customers/signup");
Customer is the Model that's used for authentication.
In the server, I see that I AM getting redirected to /customers/signup, and that redirects me to /customers/login
The thing that confuses me the most is that this works perfectly in my machine.
I dumped the return value of Auth->Login in the server, and it returns 1, so in theory everything is fine and the user should've been logged in.
Some things I can think of that are different between my machine and the server:
Dev machine is Windows, Server is Linux. This sometimes introduces case-sensitivity issues, but the signup method i'm redirecting to is all lowercase, I don't see where there could be such a problem here.
Dev machine is IIS, Server is LiteSpeed. Maybe Litespeed is screwing with something? This would be the first time in over a year running this site in production that i'd find something different because of LiteSpeed
Production site is over SSL, dev is not. I don't see how this could be a problem.
Any ideas are infinitely welcome!
Thank you!
I had problems too with authentication working fine on my machine in development mode, but not working on the server in production mode. Surprisingly, when I changed the server to development mode it started working correctly. Then I changed back to production, and it was still working. Perhaps it was some cache issue.
After a LOOOONG process of trying different weird things, it turns out it all boils down to this:
ini_set('session.referer_check', $this->host);
That's part of CakePHP's standard security features... It sets that INI setting.
If the request made to the action that'll call Auth->login is coming from another host (domain/subdomain/whatever), PHP will consider the session invalid, which effectively kills the auto-login attempt.

Resources