Skip to main content
  1. Tech/

OpenShift Error: Layer 7 Wrong Status, Invalid Response

·1 min

I have been playing with OpenShift for the past several hours. It looks great. But a while back I started to get 503 Internal Server Error.

When I checked logs using rhc tail , I saw this error: Layer 7 Wrong Status, Invalid Response 404.

I spent an hour or so troubleshooting. Turns out the issue was NetBeans had added src/main/web/app/WEB-INF/jboss-web.xml when I ran the application locally on my machine. I committed this file, thinking I might need it. Deleting it from the repo fixed the issue.

Related

Filter Some Keys in Multi Dimensional Arrays in Php

·1 min
/** * Cleans up multi-dimensional arrays. * 1st dimension is a simple index * 2nd dimension includes the desired keys * * @param mixed $array * @param mixed $keysToInclude */ public function cleanUpArray($array, $keysToInclude) { $returnArray = array(); $i = 0; foreach($array as $item){ foreach($keysToInclude as $key){ $returnArray[$i][$key] = $item[$key]; } $i++; } return $returnArray; }

MySQL Update If Exist Else Insert Procedure

·1 min
Are you tired of checking data in your code before inserting? Well MySQL procedures are here to the rescue. This simple procedure shows how you can do that: CREATE PROCEDURE ` update_insert_user ` ( IN uid2 int ) BEGIN DECLARE last_login2 DATETIME; SELECT ` last_login ` INTO last_login2 FROM ` user ` WHERE ` uid ` = uid2 LIMIT 1 ; IF last_login2 IS NULL THEN INSERT INTO ` user ` ( ` uid ` , ` last_login ` ) values (uid2, now()); ELSE UPDATE ` user ` SET ` last_login ` = now() WHERE ` uid ` = uid2 LIMIT 1 ; END IF ; END