Web Builds - Internal Server 500 error

Ok i’m having some weird issues with Internal Server 500 errors and my web builds. It was working fine in the beginning but something has seems to happen to the project. The error was not showing up at first and progressively got worse. So in troubleshooting i decided to remove all pages and controls from the project. It now has absolutely nothing in it except a blank webpage, the app, and the session. I even changed the target build name so as to not conflict. So in effect this should be a brand new bare bones nothing project. I build this and i am still getting the internal server 500 error.

Now if i create an absolutely new project with nothing in it but what it loads and then i build that project. It runs fine.

What could be causing this old project file with nothing in it to get the internal server 500 error, but a new project with essentially the same thing to run fine?

I’m using ServerWarp and Xojo 2015 r2.4

Are the old and the new cgis named the same and run from the same URL? Is that URL public? I’ve found that if I use apache authorization to block public access to our app that it almost never throws a Internal Server 500 error. If it’s public, it comes and goes sporadicly.

I get this error with Apache if I upload a new version of a build while an instance of the old build is still running. Usually have to kill all running instances of my web app to clear it up.

This is honestly driving me crazy. So i have narrowed it down i think somewhat i think and i’m not sure if it has something to do with the server or server + my code or what. I had 3 page source controls. One in my login page, one in my admin page, one in my users page with the following code:

<style type="text/css">

#bckg {
   background-image: url(url/to/img.jpg);
   background-attachment: fixed;
   background-position: center center;
   background-repeat: repeat;
   min-height:100%;
   body{min-height:100%;}
}

</style>
<div id="bckg">&nbsp;</div>

Now I was building my app in steps. I took everything out and built my login system, ran fine. I then added the admin section. got a 500 error. The reason i found it was the page source was literally because it was the only thing i had put into the admin page thus far. fine.

Removed that from admin section. built it. ran fine. Then i added my users section and i was expected the same thing since i had the same page source code in it. built it. internal server 500 error as expected. ok fine. removed it, built again, internal server 500 error to my surprise.

Soooo, from here i decided to get rid of the page source on my login page. built it, ran fine. So at this point my login system is not forwarding to the different section as i have that part commented out. I remove comment so that it will forward, built it, internal server 500 error. At this point my mind is exploding into mush.

Before hand everything was running fine with page sources and all. This has happened all of a sudden out of the blue and driving me nuts. if i comment out the forwarding to the user page section and build it will run without an internal server 500 error. So i’m not sure if there are additional problem in my user page that is causing it to throw the error when not commented.

This is just my luck though i guess as i always find these quirky things that happen to me in Xojo and i can never find a real answer and eventually give up. However, i need this to work so i guess i will be shooting myself in the head more.

It would be helpful if you could tell us what’s in each of the pageSource controls.

the PageSource controls contain the exact same code in all three web pages as listed above. Now i have finally gotten everything to work minus having these page source controls.

The problem i have come to is somehow it is corrupting the actual project file. if i add a PageSource control and enter the above code on my login page then it triggers an internal server 500 error. If i delete the control and rebuild (essentially this should be the same state as before i added the code) It WILL NOT run i get the same internal server 500 error.

However! if i undo my steps past the point of when i added the PageSource control and the code and rebuild. It runs and i am able to get into my user panel. This has been a complete headache but at least i am back to this point.

The reason i believe it is corrupting the project file is because i literally have two projects with the same exact code. However, the old project file i had saved and quit so i was never able to undo. I rebuilt the entire project with in a new project file and have gotten to the point where if i add this code in a PageSource control it will corrupt on build and throw an internal server 500 error. If i delete it, same thing internal server 500 error. If i undo the Pagesource with code it will return to normal, build, and run with no error.

Internal server error is server side. Perhaps you forgot something on the upload process?

Steps to re-upload newer version of your web app

  • kill the web application
  • upload using ftp (app and libs in binary other parts in text mode)
  • clear browser cache
  • try to load the url again

If the web app isn’t killed, most systems will overwrite using ftp and kill.
Sometimes the process hangs for a few seconds if you didn’t kill the process yourself which can cause problems.

Logs are mostly not helpfull only the console giving you some usefull information.

-Every web app must have an unique ID “com.somecompany.myapp” etc… after updating it may be still the same.

[quote=330579:@Derk Jochems]Internal server error is server side. Perhaps you forgot something on the upload process?

Steps to re-upload newer version of your web app

  • kill the web application
  • upload using ftp (app and libs in binary other parts in text mode)
  • clear browser cache
  • try to load the url again

If the web app isn’t killed, most systems will overwrite using ftp and kill.
Sometimes the process hangs for a few seconds if you didn’t kill the process yourself which can cause problems.

Logs are mostly not helpfull only the console giving you some usefull information.

-Every web app must have an unique ID “com.somecompany.myapp” etc… after updating it may be still the same.[/quote]

Thanks for the tip in regards to the unique ID. It seems that when i build using an old id that i get the internal server 500 error even though i use ServerWarp’s tools to restart the server it does not clear, perhaps its not a true restart? However, i am still not able to add the PageSource+Code above even with a new unique ID. I am able to build more projects that execute without it though. Unfortunately i do not have ssh access and full control of the server so i can’t kill processes or even look into if they are still running.

this has resolved the problem with the old project not building properly and triggering the 500 error, but still i can’t add PageSource+code.

regardless of whatever was wrong with the PageSource+code. i was able to fix it this way:

I added the following code to App.HTMLHeader:

<Style>.BackgroundImage { background-image: url("url/to/img.jpg"); background-attachment: fixed; background-position: center center; background-repeat: repeat; min-height: 100%; body{min-height: 100%;}</Style>

Then i added a webstyle named: BackgroundImage

Set each Webpage style to BackgroundImage, built, ran fine.

I am truly not sure what was going on. PageSource+code above was working just fine initially and then suddenly stopped. The only other thing i changed was i had a method that was scaling images retrieved from a database. with the following code found on this forum:

  #if DebugBuild=False then
    #pragma BackgroundTasks false
    #pragma BoundsChecking false
    #pragma NilObjectChecking false
    #pragma StackOverflowChecking false
  #endif
  
  dim pIn,pOut as Picture
  Dim s As RGBSurface
  Dim o As RGBSurface
  Dim x,y,xMax, yMax As Integer
  dim xx() as Double
  Dim c1, c2, c3, c4, c5 As Color
  dim xMult,yMult, a,b, xSub,ySub, xAdd,yAdd as Double
  
  if p=nil then
    Return p
    
  end
  
  s=p.RGBSurface
  if s=nil then
    Return nil
  end
  
 pOut=NewPicture( newWidth, newHeight, 32 )
if pOut=nil then
    Return nil
  end
  
  o=pOut.RGBSurface
  if o=nil Then
    Return nil
  end
  
  xMax = pOut.Width - 1
  yMax = pOut.Height - 1
  
  yMult=p.Height/newHeight
  xMult=p.Width/newWidth
  
  a=newWidth/p.Width
  if a>.5 then
    xSub=.45
    xAdd=.5
  Elseif a<.5 then
    xSub=.75
    xAdd=2
  else
    xSub=0
    xAdd=1
  end
  
  a=newHeight/p.Height
  if a>.5 then
    ySub=.45
    yAdd=.5
  Elseif a<.5 then
    ySub=.75
    yAdd=2
  else
    ySub=0
    yAdd=1
  end
  
  redim xx(xMax)
  for x=0 to xMax
    xx(x)=(x * xMult)- xSub
  next
  
  For y = 0 To yMax
    b = (y * yMult)- ySub
    For x = 0 To xMax
      a = xx(x)
      c1 = s.Pixel(a       , b  )
      c2 = s.Pixel(a + xAdd , b )
      c3 = s.Pixel(a       , b + yAdd)
      c4 = s.Pixel(a + xAdd , b + yAdd)
      
      o.Pixel(x, y) = RGB( _
      (c1.Red + c2.Red + c3.Red + c4.Red) \\ 4, _
      (c1.Green + c2.Green + c3.Green + c4.Green) \\ 4, _
      (c1.Blue + c2.Blue + c3.Blue + c4.Blue) \\ 4 _
      )
      
    Next
  Next
  
  
  Return pOut

The section “pOut=NewPicture( newWidth, newHeight, 32 )” triggered an error in the new 2017 Xojo IDE saying NewPicture did not exist. This code was found here on the forum and an attempt to smooth out the scaling of pictures since graphics does a horrible job, i have since reverted back to graphics. My old 2015 Xojo did not register this as an error. I can understand the error the new IDE gave me but what i can’t understand is why this was working perfectly before hand with a compiled cgi.

ANYWAY, i’m back to where i was about 48 hours ago. Hopefully nothing breaks again :-/.

Do me a favor. If you still have a corrupt version, please file a private bug report in Feedback. I’d love to see what’s going on here.

I’d like to but Feedback will not let me create a new case. Maybe because i’m licensed for an old version of Xojo?

Anyway if there is a different way you’d like me to submit i’d be glad too. I still have corrupt builds and project files.

To create a new case, you must do a search first, and then the button will be enabled.

As Michel said, type a summary of your problem into the search pane and then click The button on the results screen to create a new case. That’s the best way to do this… especially if it turns out to be a bug that needs to be fixed.