Coffeehouse Thread

60 posts

Greatest PHP rant of all time

Back to Forum: Coffeehouse
  • User profile image
    01001001

    I found one of the old ASP errors that MySpace used to display to users. I remember there was one time when Facebook forgot to set their .php document handler, but they never outputted errors as bad as this to the user.

     

        Server Error in '/' Application.
        Cannot open database requested in login 'myspacesharedread'. Login fails.
        Login failed for user 'AspAdoNet'.
        Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
         
        Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'myspacesharedread'. Login fails.
        Login failed for user 'AspAdoNet'.
         
        Stack Trace:
        [SqlException (0x80131904): Cannot open database requested in login 'myspacesharedread'. Login fails.
        Login failed for user 'AspAdoNet'.]
        System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +437
        System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
        System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
        System.Data.SqlClient.SqlConnection.Open() +111
        MySpace.Persistence.Dao.Profile.ProfileDao.GetSharedData(Int32[] idlist) in C:\My Documents\ReleaseBuild\Persistence\Dao\Profile\ProfileDao.cs:684
        MySpace.Persistence.Dao.Profile.ProfileDao.ConstructUser(MySpaceUserReadOnly user, Boolean isFriend, DateTime eventEndDate) in C:\My Documents\ReleaseBuild\Persistence\Dao\Profile\ProfileDao.cs:40
        MySpace.Persistence.Dao.Profile.ProfileDao.ConstructUser(MySpaceUserReadOnly user) in C:\My Documents\ReleaseBuild\Persistence\Dao\Profile\ProfileDao.cs:30
        MySpace.RemoteCaching.Client.Transports.MySpaceBackendProvider.GetAndHydrateUser(Int32 userID) in C:\My Documents\ReleaseBuild\Persistence\DataProviders\MySpaceBackendProvider.cs:18
        MySpace.Persistence.DataProviders.CachedUserProvider.GetAndHydrateUser(Int32 userID) in C:\My Documents\ReleaseBuild\Persistence\DataProviders\CachedUserProvider.cs:83
        MySpace.Web.Classes.ProfileLoader.GetUser(Int32 friendID) +111
         
        [DataMapperException: Unable to open connection to "".]
        IBatisNet.DataMapper.SqlMapSession.OpenConnection(String connectionString) +291
        IBatisNet.DataMapper.SqlMapSession.OpenConnection() +17
        IBatisNet.DataMapper.SqlMapper.QueryForObject(String statementName, Object parameterObject) +82
        MySpace.Persistence.Dao.Gateways.SharedGatewayDao.UserIdForUsername(String userName) in C:\My Documents\ReleaseBuild\Persistence\Dao\Gateways\SharedGatewayDao.cs:43
        MySpace.Web.Classes.ContextualInfo.ProfileDisplayContext.get_ContextualFriendID() +169
        MySpace.Web.Classes.ContextualInfo.ProfileDisplayContext.get_CurrentContextualUser() +19
        MySpace.Web.UI.ProfileDisplayBasePage.Page_PreInit(Object sender, EventArgs e) +39
        System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
        System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
        System.EventHandler.Invoke(Object sender, EventArgs e) +0
        System.Web.UI.Page.OnPreInit(EventArgs e) +2009804
        System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +521
    

  • User profile image
    ZippyV

    , 01001001 wrote

    At least Facebook/PHP made it. MySpace running on C# and Blue Dragon was constantly crashing and people eventually left. The MSSQL driver couldn't handle the load.

    Your SiteSpace clone couldn't handle the load either and you had to fallback to writing native Apache plugins.

  • User profile image
    01001001

    @ZippyV:

    There was no cloud back then. It was running on a single server, and at one point it was getting 100k+ hits per day and making $100 per day on Adbright ads.

    Only 2 Apache modules were written for it in C. One was for multiple subdomains like LiveJournal. The Apache request came in and if it matched the domain, it would look up the subdomain as the username in a GDBM binary hash and forward the request to that user's directory. Later it just forwarded it to the MVC controller with the username as the param.

    That could easily have been done with mod_rewrite on a server with a lighter load. RDBMS being hit on every single request to resolve subdomains to paths on compiled pages would have crashed the server with that type of high load.

    The 2nd was for uploading video files.

    Again, if EC2 was around back then and the load could have been distributed with nginx ELB, there wouldn't have been a need for custom Apache modules.

    Imagine 1 server with 512MB ram taking in 1000+ HTTP connections in real time. Even with memcached and compiled pages, it was undoable.

    Today with AWS and PHP, that's no big deal. The only key difference today is that the client is highly decoupled from the data. No big website every queries a DB to visualize data anymore. Now there is always a middle tier API layer so that the site, the mobile apps, and 3rd parties can all use the same data layer.

    Again, everything today is distributed, so it was a different time with different needs. SiteSpace was up more and had less errors than MySpace. It didn't have a bazillion dollar advertising budget like MySpace however.

  • User profile image
    Bass

    Relevant..

  • User profile image
    cheong

    @1001001:You do realize CustomErrors has always been defaulted to "RemoteOnly", don't you?

    Now you just need to create fancy error reporting page and set it as "defaultRedirect".

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    01001001

    2 hours ago, cheong wrote

    @1001001:You do realize CustomErrors has always been defaulted to "RemoteOnly", don't you?

    Now you just need to create fancy error reporting page and set it as "defaultRedirect".

    I'm sorry. I just foolishly assumed that NewsCorp with it's 8000000000000000000000000000000000000$$$$ could hire a .NET developer who would know that before putting their ReleaseBuild live. I copy pasted that error several years ago while browsing the MySpace.com website.

    Or that they could scale MSSQL before causing the downfall of their careers and ultimately the  loss of their jobs.

    I had a surreal moment in Santa Monica last year with one of the senior MySpace developers who admitted he never really used it correctly and prefers Python. This after Microsoft hand held them from 2005-2008.

    If that much money and hand holding can't scale MS tech up, then it seems hopeless.

    I was offered free Azure, and I refused it even at no cost and continue to pay Amazon, albeit a negotiatedly reduced price.

    WTF.

  • User profile image
    01001001

    I'm only posting this because it's public knowledge and most people need to know.

    MySpace was Microsoft's flagship technology product in Social. They gave them everything and beyond to float the site, and it still sunk.

    Today they're sinking tens of millions of dollars into Techstars, Founder Institute and other incubators offering them 100k+ in free Azure, cash prizes and offering to pay developers.

    The latest was an initiative to cash-centicize start-ups into using Kinect for new commercial products:

    http://blogs.msdn.com/b/kinectforwindows/archive/2012/04/02/microsoft-s-kinect-accelerator-begins-today.aspx

    Microsoft has spent huge cash trying to fix their MySpace boo-boo these past 4 years, but none of these start-ups are even going to come close.

  • User profile image
    cheong

    @1001001:

    , 01001001 wrote

    I'm sorry. I just foolishly assumed that NewsCorp with it's 8000000000000000000000000000000000000$$$$ could hire a .NET developer who would know that before putting their ReleaseBuild live. I copy pasted that error several years ago while browsing the MySpace.com website.

    It could be because of deployment procedure. Many companies doesn't allow people to install IIS to their own desktop, and WebMatrix at that time is a bit insufficient for coding large scale applications...

    In VS2010, the IDE create web.Debug.config and web.Release.config (In fact, one per each profile that you create) by default on new web application precisely for this kind of situation.

    @1001001:

    I was offered free Azure, and I refused it even at no cost and continue to pay Amazon, albeit a negotiatedly reduced price.

    WTF.

    I also found limited use for Azure because many web application code still have linkage to MS Office via VSTO or COM interop. Unless they provide a way for Azure code to interact with Office 365 or provide other kinds of replacement, there's difficulty porting existing code to run on Azure.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    01001001

    @cheong:

    Many companies doesn't allow people to install IIS to their own desktop

    From my conversations with the devs, it wasn't the most corporate of development environments. I am pretty sure they could install whatever they wanted.

    On a related note,

    It's funny, but the first thing they asked SeaDragon to do when they acquired them was to dump Netscape/OGL and rewrite for DirectX and re-brand it Photosynth.

    The first thing they asked Powerset to do is dump Hadoop/HBase and port over to their platform.

    It's like everything that had momentum when it was acquired by MSFT goes all to sh1t shortly after they make them port over to MS tech stack.

    MS has funded so many start-ups through TechStars and Founder Institute and WP7 app builders now and practically nothing has come of it. We'll see if they can hit the lottery in the next couple years.

    Maybe they can stage a Mark Zuckerberg-a-like on WinRT crack.

  • User profile image
    SteveRichter

    , 01001001 wrote

    MySpace was Microsoft's flagship technology product in Social. They gave them everything and beyond to float the site, and it still sunk.

    .NET, C#, MVC, ... are much improved nowadays. Would the tools available now have been able to fix whatever technical problems there were with MySpace?

    Can the case be made that whatever debacles there were in recent years, those failings were used by Scott Gu, Anders and others to spur the terrific advances we have seen in the languages and run times?

     

     

  • User profile image
    Bass

    Notably ASP.NET MVC didn't exist when they started work on MySpace. Really these "what programming languages are the best" kind of arguments are pointless because code software is 99.99% the human behind the computer and 0.01% the programming language. All programming languages generally share the same basic features anyway.

  • User profile image
    cheong

    @Bass:Well said. It's programmers who write crap, instead of compilers (or interpreters?) that produce crap.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    01001001

    @cheong:

    While I generally agree with that statement Bass made, in he case of MySpace I disagree. Most of the time MySpace went down it's because the SQL server ran out of connection pools as seen in the error above. The server simply "goes away" to the program logic connecting to it via the RDBMS driver and it doesn't know how to handle that.

    MySpace had the best DBA's Rupert Murdoch's gold could buy and it still wasn't workable. Meanwhile Facebook running on MySQL and later Cassandra scaled fine. Beyond a read replica or a multi-master cluster which would have been totally inadequate for Facebook, MySQL really isn't that easy to scale up to that level. But they were able to do it, and the MS MySpace team weren't.

    That and they charge an arm and a leg for MSSQL licenses for those headaches.

  • User profile image
    cheong

    @1001001: The problem is with a website's configuration file, how does it related to the database?

    Even if it changed to MySQL, the problem would still be there.

    That said, being able to hire the best <whatever> gold could buy doesn't automagically mean he/she'll be free of careless mistake, especially when the real work is done by people working under him/her.

    They may set rules to avoid this kind of mistake, but we all know that whenever human intervention is involved, there could be unexpected errors.

    I'm not saying that could be excusable, just saying life is like that.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    01001001

    @cheong: Look at the stack trace. The MSSQL db auth information was fine ( AspAdoNet/**** ). The server stopped taking connections and was deadlocked in a wait. The SQL driver simply reported the wrong message.


    AFAIK this doesn't happen with ZooKeeper based big column dbs, because ZooKeeper forwards the connection.

    http://wiki.apache.org/hadoop/ZooKeeper/ErrorHandling

    Plus the DAOs that interface those databases are largely transactional.

    Imagine for a second what Google would be like if they had used the same stack as MySpace with the little C# dao classes. It would be intolerable to use.

    The fact that I could see the stack trace as a user browsing the website is an easy error to fix, but lets face it, that should never happen.

     

  • User profile image
    cheong

    The error message says the user is okay, but can't be used to open the required database. (Typical Microsoft error messages in the old days... Technically correct but could be out of context. There was even jokes about helicopter driver in got lost on a foggy day for that)

    But I think on MySQL you'll also get silence when it occurs.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    01001001

    @cheong:

    Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'myspacesharedread'. Login fails.
    Login failed for user 'AspAdoNet'.

    The server was overloaded, the connection pools ran out. All existing connections were forced into wait, and the connection timed out.

    Does Microsoft even have a version of BigTable? Or do they just want people to use MongoDB?

    Thank goodness Powerset made HBase open source, because that would have killed it when they got acquired by MSFT.

  • User profile image
    cheong

    @1001001:Really? I think SqlClient have specific exception message for timeouts. I've experienced quite a few times in the past.

    Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.

    EDIT: And because of connection pooling, I think it's impossible for most configurations to run out of connection limit on the database side even on clustered server farms.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.