Sunday, March 6, 2016

LAMP stack


LAMP, as the name suggests is a typical model of software subsystems (historically Linux, Apache, MySQL and PHP) bundled together to give a platform on the top of which web service based and similar applications may be deployed.
Why LAMP?
1.      Components are largely interchangeable. The software subsystems may vary, but since Linux, Apache, MYSQL and PHP are free, this combination is considered to be most common.  Other common variants are:
·         LAPP - Linux, Apache, PostGreSQL, Perl/Python/PHP
·         WAMP - Windows, Apache, MySQL, Perl/Python/PHP
·         MAMP - Macintosh, Apache, MySQL, Perl/Python/PHP
·         BAMP - BSD, Apache, MySQL, Perl/Python/PHP
·         WIMP - Windows, IIS, MySQL, Perl/Python/PHP
·         AMP - no operating system
We may justify why LAMP stack, by listing all the benefit of the components used and beauty is the interchangeability of the components, so choose the benefits you like.
2.      Availability of vast variety of free plugins make it even more lucrative; for example netsniff-ng (free Linux network analyzer and networking toolkit), Snort (an open source network-based intrusion detection system), RRDtool (round-robin database tool), Nagios (offers monitoring and alerting services for servers, switches, applications and services),collectd (a Unix daemon that collects, transfers and stores performance data of computers and network equipment) and  Cacti(web-based network monitoring and graphing tool) etc.
3.      Supports multiple server farm solutions for high loads and better availability. This is possible with additional components like load balancer.
4.      Deployment of applications is straight forward, in most scenarios, it may be copy and paste content. For most of the Linux based system, this is available by default.
5.      Security may not be an issue, being an open source and large user base, problems are resolved faster than what you could expect from other paid products.
6.      You may use various free packages to configure LAMP and similar solutions. One such famous package is XAMPP (cross platform, Apache, MYSQL/MariaDB, PHP, Perl) with vast variety of add-ons available for XAMPP.
Drawbacks of LAMP stack
Most of the time, when we are counting drawbacks of LAMP, we are cursing one of the software component being treated as one of the four layers or how they are integrated.
For example we may say, Apache is not the highest performant today in market, or point some issues in PHP or MYSQL and so on. 
You have to be very careful about choosing the right components, say the functionalities you need in your application need PHP 7.0, but if solution you are going for doesn’t support latest version at all, you may be in trouble (even though it may not be considered as a drawback for you since you know this issue and you will plan accordingly now). 
Alternative Technologies
LAMP is used to serve web content and pretty much everything which is capable of this feature, is an alternative in my opinion, be it the c# and .Net based webAPI’s or Java Servlet API  and so on. But when we talk about alternative technologies, we are generally changing one of the components and comparing them due to a variation in underlying components. For example LEMP stack (Linux, Nginx, MariaDB/MySQL, PHP) is a variant where Nginx replaces Apache. Few of the other variations are listed under “Why LAMP?” section above.
Mean Stack is termed as collection JavaScript based technologies used to develop web applications and I feel the strongest competitor today. It consists Node.js (server side JavaScript execution environment), Express (lightweight framework used to build web applications in Node, MongoDB ( schemaless NoSQL database system, considered far more better than MYSQL and similar) and AngularJS ( JavaScript framework developed by Google).
§  MongoDB is built for cloud and with lesser cost for better hardware today makes it more appealing than MYSQL and related. (But who says DB layer in LAMP cannot be MongoDB !!!)
§  Agreed, Node.js simplify the application development.
Benefits of Mean stack over LAMP stack are covered in lot more depth by Wayner (2015).
References
Brown, M. (2007, August 24). Understanding LAMP and its effect on web development. Retrieved from http://www.webopedia.com/DidYouKnow/Computer_Science/LAMP.asp
Howitt, J. M. (2010, January 27). What are the advantages and disadvantages of running PHP on Windows [Web log comment]. Retrieved from http://stackoverflow.com/questions/2145108/what-are-the-advantages-and-disadvantages-of-running-php-on-windows
Leith, E. (2011, March 28). What are some disadvantages of LAMP stack? [Web log comment]. Retrieved from https://www.quora.com/What-are-some-disadvantages-of-LAMP-stack
LEMP [Computer software]. (2016). Retrieved from https://lemp.io/
Telly, B. (2013, March 08). Re-writing a large web application - alternatives to LAMP [Web log comment]. Retrieved from http://programmers.stackexchange.com/questions/189771/re-writing-a-large-web-application-alternatives-to-lamp
Wayner, P. (2015, June 22). LAMP diehards take note: The flexible simplicity of MongoDB, ExpressJS, AngularJS, and Node.js is no joke. Retrieved from http://www.infoworld.com/article/2937159/application-development/mean-vs-lamp-your-next-programming-project.html

XAMPP [Computer software]. (2015, December 31). Retrieved from https://www.apachefriends.org/add-ons.html

Are you a successful Web Developer?

Features the websites are expected to deliver had been ever increasing. As the scope becomes vast so do the opportunities for genii who have the potential to materialize these business needs. Now the question is what makes you as developer and path finder qualified enough to survive in this dynamic domain!!

Well, I have no prescription pills for you today which you can eat and you are good to go. But I may give you glimpses of, in what direction digital world is moving and what is expected today. It may be altogether a different story five years down the line!! It was only in 1990 when the first page was served on the open internet, just in twenty five years, look around where we are. The way content in managed and delivered or consumed is altogether took a different direction. Does that mean you want to be mere a speculator? I assume no, that’s why you are with me here today, right.

Those days are gone, when these tiny websites were used to deliver unsecured content and online content was considered to be optional for big names to be available. Today these websites are serving not only public content but highly confidential material which may worth billions and make an organization bankrupt if leaked. Now the only way left with we developers is to be a hacker. Does is it sounds crazy? But I mean it, the security measures we develop as we evolve to secure content is meant to be tweaked around and hacked at some point of time by someone smarter than the creator. So we need to constantly be one step ahead. The only way to maintain balance for own good is to patch the security hole before someone else find it.

If you have worked with any big service based organization, you must have observed they emphasize and appreciate reusable assets across the verticals and horizontals a lot. We see more and more versatile tools/products/complete solutions floating around in today’s era. Does this mean if you are making something reusable or launching a multidimensional versatile product, you are eating up developer’s job? This may sound crazy but answer is no. The rate with which demand is increasing supply is far behind. It only means we are trying to use resources in a better manner. But if you are kind of developer who is not willing to learn new things and utilize other’s efforts judiciously, in today’s market, it is difficult for you to survive. Yes, you must attain an expertise in a technology but don’t do the mistake to be dump enough and thrown off the business. World is changing around open your eyes.

Many new websites and solutions are launched very often today, but the one which earn more customers are able to survive. Here comes the unspecified and ever changing common sense of developers which they can utilize to make the projects profitable enough and earn repetitive business. You as a developer must create a product keeping usability aspects in mind. This may have included only a better css in past but today it means a lot more. A website may die soon without being device independent and companion iOS and android apps. This also means there is wider scope for developers to exist today in itself.

This may seem an endless topic to discuss but there is a finite shortcut here which you may always keep in mind. Now does it sound like a magic path? Well possibly it is but I call it a pointer, nothing more than that. Right from Archie search engine in 1990’s to google today, master minds are toiling to make it easy for end user to reach content of their interest as fast as possible. Why not keep eyes on search engine ranking logics prevalent the day today!! Google may rate a website better if it is mobile friendly, faster, authentic content wise, secured enough, liked by the mass (and many more).

But remember, these are only some of the parameters you may follow to help realize goals of your client.  If you win your client’s faith you are successful in this domain and remember client is smarter than you always, that’s why they hired a genius like you. If technology and you as a developer are evolving, so are the consumers becoming smarter.



References

Westerwick, A. (2013), Effects of Sponsorship, Web Site Design, and Google Ranking on the Credibility of Online Information. Journal of Computer-Mediated Communication, 18(2), 80–97. doi: 10.1111/jcc4.12006

Friday, March 4, 2016

Web is stateless

HTTP is a stateless protocol. You may use cookies and sessions to maintain the state of an application specific to an end user.
What are the differences between sessions and cookies?
Cookies
HTTP cookie (web cookie/ Internet cookie, browser cookie or simply cookie) is a small piece of data sent from a website and stored in the user's web browser while the user is browsing. If  programmer doesn’t assign an expiration date to the cookie, it is lost with browser close. These are In-memory cookies for the browser, on the other hand you may set expiration date for the cookie to make it Persistent cookie. Persistent cookie deems to be stored on the client side hard drive and retrieved on next visit of website based on expiration date set by server side..
Programmers may use Response object to create and set cookie values, and Request object to retrieve the values of cookies created during previous interaction. Cookies are associated with a website, not with a specific page, so the browser and server will exchange cookie information no matter what page the user requests from your site (exception: see benefit section for Path property of Cookies).
Limitations:
1. The security of cookie generally depends on the security of the issuing website and the user's web browser, and on whether the cookie data is encrypted. Security vulnerabilities may allow a cookie's data to be read by a hacker, used to gain access to user data, or used to gain access (with the user's credentials) to the website to which the cookie belongs. You should never store sensitive data in a cookie, such as user names, passwords, credit card numbers, and so on. Do not put anything in a cookie that should not be in the hands of a user or of someone who might somehow steal the cookie information. This also means, on server side you should safeguard server side logics with extra validations, when you are taking inputs from cookies. (Less secured than session)
2. Most browsers support cookies of up to 4096 bytes. This limit is applied to the name-value portion of the cookie only. (No size limits in session)
3. Most browsers allow only 20 cookies per site; if you try to store more, the oldest cookies are discarded. Some browsers also put an absolute limit, usually 300, on the number of cookies they will accept from all sites combined. So, you may have to create cookies with sub-keys, in case you are reaching the count limits. ( No count limit in sessions)
4. User has the rights to deny using cookies. As per Cookie Law, your website must inform visitors how you use cookies. Also, you must write a dummy cookie in your web application implementation and read on server side, to verify if current browser of user is supporting cookies. (Session is server side, so user can’t handle /control sessions)
5. User has the ways to clear cookies on his web browser, no matter what expiration time you mentioned. (User can’t clear sessions without exposed functionality given to user)
6. You must check for nonexistence of a cookie key in request object to avoid null reference errors. (But similar is also true for sessions too)
7. In the request object, you will not get the expiration date of the cookie, if you are too much concerned about expiration date; you need to reset it every time on server side. (Session timeout is controlled in web.config in .net apps)
Benefits:
1. You may limit the scope of specific cookie to specific folder of website by defining Path property of cookie.
2. You may set the Domain property of cookie to limit scope to a specific domain/sub-domain.
3. You may request a browser to delete a cookie by setting expiration date earlier than current time, say yesterday.
4. You may create a new cookie on server side with same name as existing cookie and send its value to client, to modify an existing cookie.
5. We will discuss later in this post, what are server side sessions and how they may get benefit from cookies.
Session
A session can be defined as server-side storage of information that is desired to persist throughout the user's interaction with the web site or web application. Dealing with sessions without cookies is a mess as described in benefits of cookies above. Web applications transmit session Ids from server side as cookie, so that during next request session id in next request may identify the session. Some older browsers do not support cookies or the user may disable cookies in the browser, in that case sessionId may be munged in the each href clickable on the page. This seems more unsecured to me than disabling cookies though.
Types of Session Implementation: Sessions may be implemented in-memory on server side (InProc session mode), using state server services (Aspnet_state.exe), SQL server or by custom providers in .Net applications and SQL Server session mode is a more reliable & secure session state management as per Jana (2009). In PHP based applications, you may edit php.ini and set the session.save_handler and use external DB to store sessions as per Waterson (2015). Possible values for save_handler in PHP could be files (default), mm, database and SQLLite. PHP provides a function that lets you override the default session mechanism by specifying the names of your own functions for taking care of the distinct tasks as per Shiflett (2004).
Benefits:
1. Easier to maintain user specific data across all the requests.
2. Kind of objects being stored are vast.
3. Much more secured and hidden from user as compared to cookies.
4. Under in-memory model, session data in a memory object of the current application domain. So accessing data is very fast and data is easily available.
5. There is not requirement of serialization to store data in InProc session mode.
6. In .Net Sessions may be handled at page level too. We may disable session or make it read-only on a specific page using EnableSessionSate property of page.
Limitations:
1. There is an overhead involved to serialize and de-serialize  objects in case of StateServer  and SQLServer session modes.
2. Under InProc session mode, If the worker process or application domain is recycled, all session data will be lost. We may want to switch to state services, external DB or custom provider here.
3. InProc session mode is the fastest, more session data and more users can affect performance, because of memory usage.
4. Under multiple server farm scenarios, InProc session mode is not used at all.
When might a developer choose one or the other?
First thing first, as defined in definition of session above, session needs cookie to be implemented for storing session Id at least. If a specific information need not be secured (as defined in  limitation 1 of cookie above), and the size is small, cookie may be chosen to store this information, e.g. cart items of the user, user preferences without login for next visit on the same site and so on. On the other hand, secured and heavy information is never passed on to client side cookies as defined in benefit 3 of session above.
Are there any privacy or security implications to using either?
Session objects are on server side, that does not mean they are fully secured, but for sure much more secured than cookies on client side they are. Sessions will be as much secure as you make them, but cookies don't qualify to be in this race as defined by limitation 1 of cookies. You may try to make session more secured by using external DB or use EnableSessionSate property of web pages to make them more secured in .Net.
What benefits do they provide to the developer that might override those privacy and security implications?
Cookies put less overhead on the server side, if the information need not be secured like tracking cookies, website usability etc. we may choose it. Detailed benefits and limitations of cookies as compared to sessions may be analyzed in Limitation/Benefit sections above.
References
Auger, R. (2011, January). Cross Site Scripting. Retrieved March 03, 2016, from http://projects.webappsec.org/w/page/13246920/Cross Site Scripting
Iain. (n.d.). Browser Cookie Limits. Retrieved March 03, 2016, from http://browsercookielimits.squawky.net/
Jana, A. (2009, January 23). Exploring Session in ASP.NET. Retrieved March 03, 2016, from http://www.codeproject.com/Articles/32545/Exploring-Session-in-ASP-Net
LassoSoft. (n.d.). Lasso Programming: Tutorial: Understanding Cookies and Sessions. Retrieved March 03, 2016, from http://www.lassosoft.com/Tutorial-Understanding-Cookies-and-Sessions
Microsoft. (n.d.). Maintaining Session State with Cookies. Retrieved March 03, 2016, from https://msdn.microsoft.com/en-us/library/ms526029(v=vs.90).aspx
Microsoft. (2011). ASP.NET Cookies Overview. Retrieved March 03, 2016, from https://msdn.microsoft.com/en-us/library/ms178194(v=vs.100).aspx
Optanon. (n.d.). The Cookie Law Explained. Retrieved March 03, 2016, from https://www.cookielaw.org/the-cookie-law/
Shiflett, C. (2004, December 14). Storing Sessions in a Database. Retrieved March 03, 2016, from http://shiflett.org/articles/storing-sessions-in-a-database

Waterson, K. (2015, May 8). Introduction To PHP Sessions. Retrieved March 03, 2016, from http://www.phpro.org/tutorials/Introduction-To-PHP-Sessions.html

Saturday, February 27, 2016

Security threats associated with exposed server side error details

Security threats associated with exposed server side error details
This topic may be categorized under penetration testing and hacking for a website. According to Open Web Application Security Project (2014), there are many SQL Injection exploitation techniques that utilize detailed error messages from the database driver. Further in depth testing and code review may help determine possible vulnerabilities and minimize the risk.
Improper error handling is not only unpleasant for the end user, but also serves as a starting point for the hackers to define strategy by exposing high level and low level software components deployed to build an application. It may include how the website is logically built up from top to bottom along with database schema. If an expert attackers knows exactly the building blocks and DB schema of an application, he is half done stealing the confidential information you may be hiding from anonymous users.
All the software bundles provide developers with basic building blocks which may be used to do robust error handling. For example:
·         Apache is a common HTTP server for serving HTML and PHP web pages. By default, Apache shows the server version, products installed and OS system in the HTTP error responses. Responses to the errors can be configured and customized globally, per site or per directory in the apache2.conf using the ErrorDocument directive. In case of error, Apache can be configured to output hardcoded error message, a customized message, redirect to external or internal page using ErrorDocument directive. Administrators may configure AllowOverride using .htaccess file. For allowing ErrorDocument you need to set AllowOverride to All. ServerTokens and ServerSignature may be configured to hide server specific information in http errors.
·         Generally Microsoft technologies based web applications are deployed on Internet Information Services (IIS). In a typical .Net web application, developers may suppress the unhandled errors being exposed to users by custom error page. A .Net web application which shows yellow screen of error is built by novice team of developers. In some of the applications, error handling is taken very seriously using custom exception handling http modules. Along with custom error page a unique identifier is sent as a hidden variable to the client side, which end user may be easily instructed to share with support team. This unique identifier is generated by the custom http error handling module, and saved along with error information in multiple possible ways. Some the applications I have seen use third party frameworks like Elmah and Log4net for robust logging in flat text files and error database. A detailed low level application design defines what information is required by end user to do correction in input data and what else is to be hidden by the error handling modules assigning a tracking unique identifier.
Next time, when you are in development phase of a web application, remember that your responsibility to handle errors does not end with a try catch finally. There must be low level details specified and planned for well ahead. Some hacker on the other corner of this world is waiting for you to shirk work.


References
Apache Software Foundation. (2015, December 10). Log4net (Version 2.0.5) [Computer software]. Retrieved from https://www.nuget.org/packages/log4net/
Aziz, A. (2012, April 13). ELMAH (Version 1.2.2) [Computer software]. Retrieved from https://www.nuget.org/packages/elmah/
Open Web Application Security Project. (2014, August 8). Improper Error Handling. Retrieved February 23, 2016, from https://www.owasp.org/index.php/Improper_Error_Handling
Penn Computing. (2016, February 26). SWAT Top Ten: Improper Error handling. Retrieved February 26, 2016, from http://www.upenn.edu/computing/security/swat/SWAT_Top_Ten_A7.php

The Apache Software Foundation. (2016). Apache Core Features. Retrieved February 26, 2016, from http://httpd.apache.org/docs/2.2/mod/core.html

Sunday, June 28, 2015

Analyze loopholes in SharePoint Security Framework

Annotated References
Dokic, D., Zrakic, M. D., Bogdanovic, Z., & Labus, A. (2015). Application of SharePoint Portal Technologies in public enterprises. Revija za univerzalno odličnost [Journal of Universal Excellence], 4(1), A11-A25. Retrieved from http://www.fos.unm.si/media/pdf/RUO/2015-4-1/Application_of_sharepoint_portal_technologies_in_public_enterprises.pdf
This paper deals with application of portal technologies for enhanced content management, document management, and collaboration within public enterprises. The goal is to achieve efficient exchange of information on all hierarchical levels, as well as mechanisms of reporting and performance measurements, such as business intelligence and key performance indicators, taking into account concepts of scalability, availability, ubiquity and pervasiveness. A case study of application within the public enterprise Post of Serbia is used to achieve the goal. The results of analysis show that application of Information and Communication Technologies (ICT) necessarily leads to transformation of business processes that are based on flow of paper documents. In addition, application of ICT leads to standardization, changes in organization structure, and change management.

 SharePoint as an ICT needs major organizational level contribution from participants and there is no unified approach available as of date, which could be implemented to streamline process, in order for a smooth transition. When it comes to surface that this transformation is way too expensive than expected and relatively unsecure, generally it’s too late. There should be a formal study published, to identify these risk factors.

Jali, M. Z., Furnell, S. M., & Dowland, P. S. (2010). Assessing image-based authentication techniques in a web-based environment. Information Management & Computer Security, 18(1), 43-53. doi:10.1108/09685221011035250
The authors analyzed usability of two image-based authentication methods when used in the web-based environment - clicking secret points within a single image (click-based) and remembering a set of images in the correct sequence (choice-based). For direct comparison of usability same set of forty participants (thirty-three males and seven females) were given paper and web based tasks and based on user feedback, these two techniques were evaluated. The results suggest that click based authentication is more secure and choice-based authentication has better scores in terms of usability. Although participants rated the choice-based method as weak, it was still their preferred alternative for replacing passwords. This result suggests that participants preferred "convenience", albeit with an awareness of the "security" risks.

With SharePoint 2013 claim based authentication, it might be possible to insert multiple security layers enveloped under same set of services. Username and password combination along with click-based/choice-based user verification is something we need today. It’s worth a million dollar to conduct usability & technical feasibility study of suggested approach.

Nastase, P., & Eni, L. C. (2015). Developing an online collaborative system within the domain of financial auditing. Amfiteatru Economic, 17(39), 823-835. Retrieved from http://econpapers.repec.org/article/aesamfeco/v_3a39_3ay_3a2015_3ai_3a17_3ap_3a823.htm
The paper discusses technical design for online availability of audit records using SharePoint. The online audit records here means information required by both financial auditors and the employees of the Chamber of Financial Auditors of Romania. This technical design evaluation involved feasibility study and later implementation using Microsoft SQL Server 2008 R2, SharePoint Server 2010, SharePoint Designer 2010 and various implementation features: external content types, external lists, business data web parts etc. Two research methods highlighted in this paper are: the first one is empiric, based on formulating a questionnaire and the interpretation of the results, while the second is the analysis of the implementation process by using a step-by-step approach. The online audit database stores information about the results of previous audits, the opinions issued as result of audits, the results of online electronic inspections, audit firms, audited entities, risks identified etc. The conclusion was that the online database, which is updated through Internet, is feasible to implement in SharePoint, for multiple audit stakeholders including financial auditors who can sell their financial audit services benefiting from the transparency that the system provides.


This article, even though elaborates well the technical design and feasibility of SharePoint and related tools for reporting purposes and signifies use cases where business connectivity services may be leveraged. One of the most important concerns is untouched here: dynamic nature of reports (if required) based on business rules for multiple users using same platform. This must be addressed in a separate paper, considering the fact that when a solution is implemented it must cater future needs and at the same time this flexibility should not open new security loopholes.

Thursday, January 1, 2015

Send bulk email using gmail or any other server



1. Visit https://www.google.com/settings/security/lesssecureapps  and enable access for less secure apps for some time

2. Verify that your machine where powershell is available , latest version of .Net Framework is installed.

3.  Verify that in powershell you have "Send-MailMessage" available .

(in powershell window type  :---- Get-Command Send-MailMessage )

4.   Export your gmail/ any other email account contacts as csv  . Say it has name of contact column as "name"  and email as "email"

5. Create the sample html you want to send , say some dummy html

6. Here is a sample ps1 using  "Send-MailMessage" with gmail

sample script

7. Give your sleep time in powershell script  with respect to  Gmail send message limits https://support.google.com/a/answer/166852?hl=en  and https://support.google.com/a/answer/175121?hl=en

8. don't forget to disable less secure apps @ https://www.google.com/settings/security/lesssecureapps   after you are done .







Thursday, July 24, 2014

null id in entry (don't flush the Session after an exception occurs)

Sample Exception :  ( This example is using postgresql 9.3)


null id in YourModelNamespace.Model entry (don't flush the Session after an exception occurs)
NHibernate.AssertionFailure was caught
HResult=-2146232832
Message=null id in YourModelNamespace.Model  entry (don't flush the Session after an exception occurs)
Source=NHibernate
StackTrace:
at NHibernate.Event.Default.DefaultFlushEntityEventListener.CheckId(Object obj, IEntityPersister persister, Object id, EntityMode entityMode)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.GetValues(Object entity, EntityEntry entry, EntityMode entityMode, Boolean mightBeDirty, ISessionImplementor session)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at YourNamespace.UnitOfWork.NHibernateUnitOfWork.Dispose(Boolean disposing) in c:\Users\..........\UnitOfWork\NHibernateUnitOfWork.cs:line 78
at YourNamespace.UnitOfWork.NHibernateUnitOfWork.Dispose() in c:\Users\..............\UnitOfWork\NHibernateUnitOfWork.cs:line 36
at sourcenamespace.class.method(input parameters ) in c:\Users\hemant\.......\mycalss.cs:line 82
at wrapper.cs in c:\Users\hemant\.....\api\someController.cs:line 134
InnerException:

 

Possible Reasons / Solutions : 

1.  uninstall  FluentNHibernate  ,  NHibernate ,  Iesi.Collections . install FluentNHibernate   , it will automatically install correct version of NHibernate and Iesi.Collections required . Check if your app.config / web.config have wrong versions of dll's referred , may be under runtime .

2. Generally  in nhiberante mappings you define id field for the table like :

Id(x => x.somecolumn).GeneratedBy.Assigned().Not.Nullable();   // reflection to determine column name so its ok to skip .column here

//or

Id(x => x.SomeColumn).GeneratedBy.Assigned().Column("\"SomeColumn\"").Not.Nullable();

//In the above two cases , your own code is responsible to maintain unique id . So used //Assigned

//or

Id(x => x.SomeColumn).GeneratedBy.Assigned().Column("some_column").Not.Nullable();

//snake_case  so ok to skip  \"

//or

Id(x => x.Id).GeneratedBy.Sequence("\"My_Id_seq\"").Column("\"Id\"");

// in the above case you have a Sequence to generate unique ids / primary key  in db

or else

The idea is after GeneratedBy  make sure you have chosen right option as per your table  e.g.

  • Assigned :   lets the application to assign an identifier to the object before Save()  is called. ( with or without Params configuration )

  • Foreign  :  uses the identifier of another associated object. Usually used in conjunction  with a one-to-one primary key association.

  • HiLo :   uses a hi/lo algorithm to efficiently generate identifiers of any integral type, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with a user-supplied connection. requires a "special" database table to hold the next available "hi" value

  • Identity  :   supports identity columns in DB2, MySQL, MS SQL Server and Sybase. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.

  • Increment :   generates identifiers of any integral type that are unique only when no other process is inserting data into the same table. Do not use in a cluster.

  • Sequence :  uses a sequence in DB2, PostgreSQL, Oracle or a generator in Firebird. The identifier returned by the database is converted to the property type using Convert.ChangeType. Any integral property type is thus supported.


See FluentNHibernate.Mapping.IdentityGenerationStrategyBuilder  for more possible options.

 

 

 

 

 

 

Friday, May 23, 2014

An error occurred. Detailed message: An error was raised by libgit2.Category = Net (Error). Response status code does not indicate success:401 (Unauthorized).

An error occurred. Detailed message: An error was raised by libgit2. Category = Net (Error).
Response status code does not indicate success: 401 (Unauthorized).

This is what happened when I changed my password for Git Repository ( with Visual Studio Tools for Git http://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d6724bdb980c )

Solution :

  1. Close all Visual Studio instances

  2. Go to Control Panel > Credential Manager

  3. Delete the entries related to your repository.(Link )

  4. Now whenever you will try to connect to server using Visual studio , it will ask for credentials and recreate these entries in Credential manager.

Monday, April 14, 2014

Should I Pay money to Google Adsense ? Prove using Powershell

Last week I  finalized a new hosting plan . It offers me $100 worth of code for Google adsense and similar programs.  This was the 1st time I saw Google adsense with angle of an advertiser . (Probably when I last time renewed my hosting  also , I got these codes , but never used it . Was not even aware of what it is at that moment )

1st question which comes to me , do they make us fool !!! Does this $ 100 really worth something .  After all brainstorming  my conclusion is : if you are selling a product , invest only in a program  which charges you as per actual product sale .  Never invest in Google adsense and similar programs , who just take responsibility of taking user to your door on web , if they don't promise / convert in to actual sale , don't pay them .

Well, I am not saying something in air . I have valid points to prove it , if you agree with below mentioned , you must admit what I said above :

Wednesday, April 9, 2014

Muliple Get, Put, Post, Delete under Web API calls to same Controller from Angular JS

In the example mentioned below , you could define multiple PUT to same Web API controller

Thursday, April 3, 2014

How to Post on all of your FaceBook Groups Using Powershell ?

Powershell script saved as text here( Auth codes removed)


#1. This PowerShell script demonstrate how to use Facebook API's in PowerShell .
#2. How to load new framework dll . (Details How to load .Net 4 compiled dll in Powershell ? ) 
#3. How to generate Auth Access Token in facebook. (Details How to generate Facebook token ? )
#4. How to read online xml file which may be site map . (How to read online xml using PowerShell?  $onlineXMLSitemap = "http://sharepoint.asia/sitemap.xml" ;$doc = New-Object System.Xml.XmlDocument;$doc.Load($onlineXMLSitemap);
#5. How to run c# code from powershell directly . (Add-Type -ReferencedAssemblies $mAs -TypeDefinition $cSource -Language CSharp )
#6. How to solve overload function problem in Powershell ( Post method of facebook API has two overloads , one with Path , one without path . We are using 1st . That is why we called c# code from Powershell)
#7. How to select random entries in a collection . ($doc.urlset.url | Get-Random -count 1 | ForEach-Object )
#8. Business purpose resolved : Randomly post on Facebook in my all groups . This script picks one random url from provided Sitemap.XML and post it on 100 FB Groups and your own wall . You can reduce this number though .$Groups.data  | Get-Random -count 100| ForEach-Object {
#Related terms : Bulk Post on facebook , Post on All Groups ,  Use Facebook API is Powershell , Use Facebook API is c#


How to load .Net 4 compiled dll in Powershell ?

Do you get error like :

Exception calling "LoadFile" with "1" argument(s): "This assembly is built by a runtime
newer than the currently loaded runtime and cannot be loaded. (Exception from HRESULT:
0x8013101B)"

How to generate Facebook token ?


  • Do you have your app already on Facebook Developer site?

How to read online xml using PowerShell?

This post demonstrate how you could read an xml file and manipulate using PowerShell.
# I have taken this site's sitemap as sample xml

$onlineXMLSitemap = "https://hemantrohtak.blogspot.com/sitemap.xml" ;
$doc = New-Object System.Xml.XmlDocument;
$doc.Load($onlineXMLSitemap);

# you could manipulate this xml just like an ordinary xml in object model
#below mentioned: Print a random url from my sitemap

$doc.urlset.url | Get-Random -count 1 | ForEach-Object {

Write-Host $_.loc ;

}

Sample Code :

# I have taken this site's sitemap as sample xml
$onlineXMLSitemap = "https://hemantrohtak.blogspot.com/sitemap.xml" ;
$doc = New-Object System.Xml.XmlDocument;
$doc.Load($onlineXMLSitemap);
# you could manipulate this xml just like an ordinary xml in object model

Saturday, February 22, 2014

Can I stop my screen from locking due to inactivity?

Tonight I was watching movie on my TV being broadcasted via HDMI from my Laptop.

It was annoying to force my laptop from dying every now and then.  (Somehow I was not able to change power management settings to never sleep, don’t know why!!!)



So I quickly wrote this PowerShell script, to keep on clicking at random places on my screen:

Thursday, November 21, 2013

Do you want to spend on SharePoint only for MS Office DocumentCollaboration ?

First you should know How to collaborate with SharePoint 2013 :



Now Let's see what Google provides :

Sunday, September 1, 2013

List View Threshold

List View Threshold


Sometimes you might face a situation where you get this error:

9239 items (list view threshold is 5000)

The number of items in list exceeds the list view threshold, which is 5000 items.  Tasks that cause excessive server load (such as those involving all list items) are currently prohibited.

Even though it is recommended to use prescribed limits in your queries, but

Thursday, August 1, 2013

List and Site templates in SharePoint

List Templates


Any List/Library in SharePoint can be saved as template (STP) .

Go to List/Library > Library Settings > Save document Library as Template

  1. Provide File Name, Template Name and Template description ( you can choose to include content of source in the template)

  2. You can visit List template gallery (Site settings > List template gallery) , and your template will be found saved there.  You can easily open the list template gallery in explorer view and extract the stp file on your hard disk. This can be uploaded on any site collection as target.

  3. This template is available for new list creation in current site collection wherever this List template stp file is available under List Template Gallery. Visit Site Content >Add an App > you will find your template to create new List/Library here.



  • You would be able to create a List/Library with same set of columns and views as the source of template


Please visit Library settings and observe different list settings like version setting metadata navigation, security etc.

 

Site Templates


A sub site can also be saved as template.

Go to site settings > Save site as Template

  1. Provide File Name, Template Name and Template description. Description (you can choose to include content of source sub site’s list and libraries in the template.)

  2. Please note site template is being saved as a wsp under Solution Gallery ( /_catalogs/solutions/forms/allitems.aspx)  This can be uploaded on any site collection as target.


 

  1. Go to Site content > New sub site > under template choose custom   and you can create a replica of source sub site.


 

Caution:



  • Security settings are not saved in List / site Templates

  • Default max size for list/site templates is 50 MB which can be changed by administrator. But you won’t go beyond 500 MB though


$tSize = 50000000

$myW = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

$myW.MaxTemplateDocumentSize = $tSize

$myW.Update()

 

  • List definition / site definition based on which source list / sub site was created, must be present on target.

  • List / site templates are saved in content data base of site collection.

  • Once target is created using a template, it has no relation with template. These templates are only scripts to create the target. If you missed something in source before creating a template, redo creation of target.

  • If you are looking for code level high customization on the top of default list definition, better you choose custom list definition than list/ site templates.

Wednesday, July 24, 2013

Cannot create Variation site because the parent Publishing web cannotbe found. Ensure the parent Publishing web has been spawned and tryagain

To create a child variation to root variation we create a new label under Variation Labels [http://newServerName/_Layouts/_Layouts/VariationLabels.aspx] and after this click on Create Hierarchies button on this page. 

When timer job "Variations Create Hierarchies Job Definition" runs , it tries to create the child variation site including subsite of child variations. This also includes publishing Pages Library and publishing pages.
Current status can be verified under Variation Logs[http://newServerName/_Layouts/VariationLogs.aspx]
I was trying to use timer job "Variations Create Hierarchies Job Definition" to create a child variation [es-LA] to root variation[en-US] .

But I was getting error (under Variation Logs) :

A new site sub1Site1 did not get created under Label es-LA by the variation system for source site http://newServerName/en-US/sub1Site1. Cannot create Variation site because the parent Publishing web cannot be found. Ensure the parent Publishing web has been spawned and try again.

AND

Pages did not get created under Label es-LA by the variation system for source publishing web http://newServerName/en-US/sub1Site1 because the target publishing web cannot be determined.


Below mentioned solutions did not work for me :

1. Fix the possible misalignments like problem in the relationships list[http://newServerName/Relationships List/AllItems.aspx] using VariationFixUpTool.
2. In the SharePoint file C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Resources\cmscore.es-ES.resx (installed by the language pack for Spanish)

Change the value of List_Pages_UrlName as seen below

<Data Name="List_Pages_UrlName">

<Value>Pages</Value>

</Data>

to

<Data Name="List_Pages_UrlName">

<Value>Paginas</Value>

</Data>

Save the file. Now go and restart the SharePoint 2010 Timer service. Then create the Spanish Variation.  [

Eventhough "List_Pages_UrlName" solution did not work for me for this specifc problem , but with Spanish sites you get funky behaviour out of URLS retrived from Microsoft.SharePoint.Publishing.PublishingWeb.PagesList SPobjects ,
you can give it a try !!!!]

Below mentioned solution worked for me :
1. Disable all custom built features on root variation. (spweb level features)
2. Now create new Label , submit variation creation on Variation Labels and run timer job "Variations Create Hierarchies Job Definition".
3. I was still facing issue 0x80070057 which is discussed here as a separate thread.
4. After resolving issue 0x80070057 , child variation was created.
5. Now enable all custom built features on both root variation and child variation.





0x80070057
Access "Pages" Library for Chinese Locale

Monday, July 22, 2013

Few Questions to be answered before you start a SharePoint project

Few Questions to be answered before you start a SharePoint project:

  1. Are you looking for a public facing site or an intranet portal? Do you need subset of information available on intranet to be published to outer word? Do you want to develop a portal as one stop solution for whole organization or it will be in parallel with various other system with scattered information e.g. user profiles , etc.

  2. What are the maximum users we want to target in next 5 years?

  3. Do you want to pre-plan for multilingual scenarios?

  4. The user policies and permission must be strictly defined well ahead and direct access (without SharePoint user groups) to content must be eliminated. Owners who define will manage the security must be clear and precise and well trained how to manage security in SharePoint.  Administrators and owners, who don’t know how to manage security, are the biggest loop holes in the security chain.

  5. Ownership of servers and management is a pain in butt at later stages, so must be documented and defined during initial stages.

  6.  Read only search accounts must be predefined. Using administrators as search accounts is a big security loop hole.

  7. Security patches and Upgrades for Windows Servers SharePoint SQL must be scheduled and monitored.  Blocking them forever is inviting hackers to dump the system.

  8. Antivirus scans are often ignored during planning stages. Never do that.

  9. It must be defined clearly what all need to be blob cached and duration of caching must be precise and documented. According front end server configuration might have to be changed. You may never want to blob cache secured contents.

  10. To avoid more expenditure on future upgrades maximize utilization of out of box features of SharePoint.

  11. You may never want to expose underlying framework information through headers . Plan for that during initial stages , if it is a public facing site .

  12. You may want to rely on Google analytic to understand Visitor flow and improvise the site accordingly during later stages . Plan for this .

  13. What might be the external systems from where information flows in or goes out of SharePoint future system . Plan security and minimize / define  and document the limitations .

  14. Do you want to go for automatic TFS / 3rd party deployments or want a more controlled deployments with dedicated administrator ?

  15. Have you take sign off on all the relevant SharePoint features to be accommodated in the ecosystem with capacity planning and infrastructure involved to avoid performance hits at later stages ?

You are requested to add more here as comments based on what you had to go through in your previous projects  . 

You may also like:
MOSS 2007 Troubleshooting Guide

Wednesday, June 26, 2013

Faulting application name: CcmExec.exe, version: 4.0.6221.1000, timestamp: 0x 339 6 Faulting module name: ntdll.dll, version:6.1.7601.17725, time stamp: 0x c4 8f

Ccmexec.exe refers to CCM Executive and operates as a component of the Microsoft SMS Agent Host for Microsoft Systems Management Server which handles Change and Configuration Management utility.

The error I was getting :

Log Name: Application
Source: Application Error
Date: x/xx/xxx xx:xx:xx xM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: xxxxxxx
Description:
Faulting application name: CcmExec.exe, version: 4.0.6221.1000, time stamp: 0x 339 6
Faulting module name: ntdll.dll, version: 6.1.7601.17725, time stamp: 0x c4 8f
Exception code: 0xc0000005
Fault offset: 0x0009ce74
Faulting process id: 0xbf8
Faulting application start time: 0x01 5e9 49 2bc
Faulting application path: C:\Windows\SysWOW64\CCM\CcmExec.exe
Faulting module path: C:\Windows\SysWOW64\ntdll.dll
Report Id: 59e021fb-dd92-11e2-bf93-0050568d00ab
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-06-25T12:25:42.000000000Z" />
<EventRecordID>2732038</EventRecordID>
<Channel>Application</Channel>
<Computer>MIA32132WWW004.managed.cln</Computer>
<Security />
</System>
<EventData>
<Data>CcmExec.exe</Data>
<Data>4.0.6221.1000</Data>
<Data>48339246</Data>
<Data>ntdll.dll</Data>
<Data>6.1.7601.17725</Data>
<Data>4ec49b8f</Data>
<Data>c0000005</Data>
<Data>0009ce74</Data>
<Data>bf8</Data>
<Data>01ce5e9fb49ec2bc</Data>
<Data>C:\Windows\SysWOW64\CCM\CcmExec.exe</Data>
<Data>C:\Windows\SysWOW64\ntdll.dll</Data>
<Data>59e021fb-dd92-11e2-bf93-0050568d00ab</Data>
</EventData>
</Event>

Suggested read : System Center Configuration Manager 


You may also like:

The COM+ System Application service entered the running state.


The application-specific permission settings do not grant Local Launch permission


MSDTC encountered an error (HR=0x80000171) while attempting to establish a


Question: The backing-file for the real-time session “WDC.BE95A9B1-DE15-4B78-B923-A12AB70BE951” has reached…

Tuesday, June 25, 2013

Monitor traffic b/w SQL server and front end

I want to monitor SQL traffic b/w Front End and SQL server. What could be the best approach for this ?

Reason :

In our uls logs , we are getting message :

Process : OWSTIMER.EXE (_x-_-_)
Thread ID : _x-_-_
Area : SharePoint Foundation
Category : Database
Event ID : f-_-
Level : Monitorable

Message :

A large block of literal text was sent to sql. This can result in blocking in sql and excessive memory use on the front end. Verify that no binary parameters are being passed as literals, and consider breaking up batches into smaller components. If this request is for a SharePoint list or list item, you may be able to resolve this by reducing the number of fields.

QL Profiler:

You may also like:











Question : Thread was being aborted : PerfmonInstanceIncrement

In our uls logs , we are getting message :

Process : w3wp.exe (_x-_-_)
Thread ID : _x_-_-
Area : SharePoint Server
Category : General
Event ID : 7-_-
Level : Warning

Message :

A runtime exception was detected. Details follow. Message: Thread was being aborted. Technical Details: System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.Office.Server.Diagnostics.ULS.NativeMethods.DoPerfmonInstance(Int32 instanceHandle, UInt32 pcid, Int64 lValue, PerfmonAction pcvo) at Microsoft.Office.Server.Diagnostics.ULS.PerfmonInstanceIncrement(Int32 instanceHandle, PCIDBase pcid, Int64 value)



Please help us identify the root cause and resolution for this .

We have also updated SPWebService.CollectSPRequestAllocationCallStacks property

You may also like:

Question : Memory Leak : Microsoft.SharePoint.SPRequestManager.GetContextRequest(SPRequestAuthenticationMode authenticationMode)


Question: The backing-file for the real-time session “WDC.BE95A9B1-DE15-4B78-B923-A12AB70BE951” has reached…


MOSS 2007 Troubleshooting Guide


Question : what is arpirowupdater.hxx ?


Question : what is merge.cxx ?


Monday, June 24, 2013

The COM+ System Application service entered the running state.

The COM+ System Application service manages the configuration and tracking of COM+ based components. If this service stops, most COM+ based components do not function properly. The Volume Shadow Copy Service, which is needed for Windows Backup and backup applications that rely on the Windows Backup API, requires this service.
This service is installed and enabled by default.

Log Name: System
Source: Service Control Manager
Date: x/xx/xxx xx:xx:xx xM
Event ID: 7036
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Computer: xxxxxxx
Description:
The COM+ System Application service entered the running state.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Service Control Manager" Guid=”{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx12f4}" EventSourceName="Service Control Manager" />
<EventID Qualifiers="16384">7036</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x8080000000000000</Keywords>
<TimeCreated SystemTime=”xxxx-xx-xxTxx:xx:xx.xxxxxxxxxZ” />
<EventRecordID>xxxxxx1</EventRecordID>
<Correlation />
<Execution ProcessID="508" ThreadID="7864" />
<Channel>System</Channel>
<Computer>xxxx</Computer>
<Security />
</System>
<EventData>
<Data Name="param1">COM+ System Application</Data>
<Data Name="param2">running</Data>
<Binary>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Binary>
</EventData>
</Event>

References :
Consequences of having Com+ System Application Disabled <http://communities.vmware.com/thread/238146?start=0&tstart=0>
http://technet.microsoft.com/en-us/library/dd349799(v=ws.10).aspx
http://technet.microsoft.com/en-us/library/cc781785(v=ws.10).aspx
http://social.technet.microsoft.com/Forums/windowsserver/en-US/107c8ab2-3057-4034-acf9-0179804b5aab/com-system-application-service-will-not-start-server-2008-r2



When COM+ System Application Service Start on my machine , the system becomes faster . Do you have some idea why this happens ?


You may also like:

MOSS 2007 Troubleshooting Guide


Question : Memory Leak : Microsoft.SharePoint.SPRequestManager.GetContextRequest(SPRequestAuthenticationMode authenticationMode)


The service did not respond to the start or control…


Include specific folder content in BlobCache SharePoint


Search – One or more property databases have fragmented indices.


Best practices for Blob cache



Question: The backing-file for the real-time session “WDC.BE95A9B1-DE15-4B78-B923-A12AB70BE951” has reached…

Sunday, June 23, 2013

The application-specific permission settings do not grant Local Launchpermission for the COM Server application with CLSID

The Network Access Protection (NAP) Agent is the primary service that allows a computer to function as a NAP client. The NAP Agent service is responsible for gathering client health data from the installed system health agents (SHAs) and forwarding that information to NAP enforcement clients for evaluation.



Network Access Protection (NAP) Agent error I am getting :




Log Name: System
Source: Microsoft-Windows-DistributedCOM
Date: x/xx/xxx xx:xx:xx xM
Event ID: 10016
Task Category: None
Level: Error
Keywords: Classic
User: SYSTEM
Computer: xxxxxxx
Description:
The application-specific permission settings do not grant Local Launch permission for the COM Server application with CLSID
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxFF48}
and APPID
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx9BA1} NAP Agent Service ( Component Services > Computers > My Computer > DCOM Config > NAP Agent Service )
to the user NT AUTHORITY\SYSTEM SID (x-x-x-xx) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-DistributedCOM" Guid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx407E}" EventSourceName="DCOM" />
<EventID Qualifiers="49152">10016</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime=”xxxx-xx-xxTxx:xx:xx.xxxxxxxxxZ” />
<EventRecordID>2304965</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>System</Channel>
<Computer>xxxx</Computer>
<Security UserID="x-x-x-xx" />
</System>
<EventData>
<Data Name="param1">application-specific</Data>
<Data Name="param2">Local</Data>
<Data Name="param3">Launch</Data>
<Data Name="param4">{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxFF48}</Data>
<Data Name="param5">{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx9BA1}</Data>
<Data Name="param6">NT AUTHORITY</Data>
<Data Name="param7">SYSTEM</Data>
<Data Name="param8">x-x-x-xx</Data>
<Data Name="param9">LocalHost (Using LRPC)</Data>
</EventData>
</Event>

References :
http://technet.microsoft.com/en-us/library/cc735503(v=ws.10).aspx
http://social.technet.microsoft.com/Forums/systemcenter/en-US/dfc465bc-7bbd-483e-b98b-2ba56fa98313/the-applicationspecific-permission-settings-do-not-grant-local-launch-permission-for-the-com-server

You may also like:

MOSS 2007 Troubleshooting Guide


The COM+ System Application service entered the running state.

The following fatal alert was generated: 10. The internal error state is 1203.

Log Name: System
Source: Schannel
Date: x/xx/xxx xx:xx:xx xM
Event ID: 36888
Task Category: None
Level: Error
Keywords:
User: SYSTEM
Computer: xxxxxxx
Description:
The following fatal alert was generated: 10. The internal error state is 1203.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Schannel" Guid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx5C85}" />
<EventID>36888</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x8000000000000000</Keywords>
<TimeCreated SystemTime="xxxx-xx-xxTxx:xx:xx.xxxxxxxxxZ" />
<EventRecordID>xxxxxx9</EventRecordID>
<Correlation />
<Execution ProcessID="xxx" ThreadID="xxxx" />
<Channel>System</Channel>
<Computer>xxxx</Computer>
<Security UserID="Sx-x-x-xx" />
</System>
<EventData>
<Data Name="AlertDesc">10</Data>
<Data Name="ErrorState">1203</Data>
</EventData>
</Event>
Resolution : How to enable Schannel event logging in IIS < http://support.microsoft.com/kb/260729 >

Related :

What's New in TLS/SSL (Schannel SSP) <http://technet.microsoft.com/en-us/library/hh831771.aspx>
SSL/TLS communication problems after you install KB 931125<http://support.microsoft.com/kb/2801679>

Saturday, June 22, 2013

Question: The backing-file for the real-time session "WDC.BE95A9B1-DE15-4B78-B923-A12AB70BE951" has reached its maximum size.

Under eventvwr we are getting this message. Please help.

The backing-file for the real-time session "WDC.BE95A9B1-DE15-4B78-B923-A12AB70BE951" has reached its maximum size.

Question : Memory Leak :Microsoft.SharePoint.SPRequestManager.GetContextRequest(SPRequestAuthenticationModeauthenticationMode)

In our uls logs , we are getting message :

Process : OWSTIMER.EXE (_x-_-_)
Thread ID : _x_-_-
Area : SharePoint Foundation
Category : Performance
Event ID : n-_-
Level : Unexpected

Message :

An SPRequest object was not disposed before the end of this thread. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. Due to flags specified at object creation, this will not be freed until processed by garbage collection. Allocation Id: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} This SPRequest was allocated at at Microsoft.SharePoint.Library.SPRequest..ctor() at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) at Microsoft.SharePoint.SPRequestManager.GetContextRequest(SPRequestAuthenticationMode authenticationMode) at Microsoft.SharePoint.Administration.SPGlobalAdmin.get_ServerLanguage() at Microsoft.SharePoint.Administration.SPSqmTimerJobDefinition.Execute(Guid targetInstanceId) at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTimerService, Int32& result) at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result)



Please help us identify the root cause and resolution for this .

We have also updated SPWebService.CollectSPRequestAllocationCallStacks property
A similar one

A similar one :

Process : w3wp.exe (_x-_-_)
Thread ID : _x-_-_
Area : SharePoint Foundation
Category : Performance
Event ID : f-_-
Level : High

Message :

An SPRequest object was not disposed before the end of this thread. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. This object will now be disposed. Allocation Id: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx} This SPRequest was allocated at at Microsoft.SharePoint.Library.SPRequest..ctor() at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) at Microsoft.SharePoint.SPWeb.InitializeSPRequest() at Microsoft.SharePoint.SPSite.OpenWeb(Guid gWebId, Int32 mondoHint) at Microsoft.SharePoint.SPFeatureManager.EnsureSiteAndWeb(SPUrlZone zone, Guid databaseid, Guid siteid, Guid webid, SPSite& site, SPWeb& web) at Microsoft.SharePoint.SPFeatureManager.<>c__DisplayClass25.b__24() at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param) at Microsoft.SharePoint.SPFeatureManager.GetAllFeatureListTemplates(Byte[]& userToken, Guid& tranLockerId, Int32 nZone, Guid databaseid, Guid siteid, Guid webid, String& sxmlListTemplatesXml) at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListTemplates(String bstrUrl, ISP2DSafeArrayWriter pTemplateData) at Microsoft.SharePoint.Library.SPRequest.GetListTemplates(String bstrUrl, ISP2DSafeArrayWriter pTemplateData) at Microsoft.SharePointSPListTemplateCollection.InitTemplates() at Microsoft.SharePoint.SPWeb.get_ListTemplates() at Microsoft.SharePoint.SoapServer.SiteDataImpl.GetListXml(XmlTextWriter w, SPWeb spWeb, SPList spList, Boolean ignoreSecurityIfInherit, Int32 schemaVersion) at Microsoft.SharePoint.SoapServer.CListChange.WriteChanges(XmlTextWriter w) at Microsoft.SharePoint.SoapServer.CChange.WriteChildren(XmlTextWriter w) at Microsoft.SharePoint.SoapServer.CWebChange.WriteChanges(XmlTextWriter w) at Microsoft.SharePoint.SoapServer.CChange.WriteChildren(XmlTextWriter w) at Microsoft.SharePoint.SoapServer.CSiteChange.WriteChanges(XmlTextWriter w) at Microsoft.SharePoint.SoapServer.SiteDataImpl.GetChanges(ObjectType objectType, String contentDatabaseId, String& startChangeId, String& endChangeId, Int64 maxChangesToFetch, UInt32 maxSPRequests, Boolean getMetadata, Boolean ignoreSecurityIfInherit, Int32 schemaVersion, Boolean& moreChanges) at Microsoft.SharePoint.SoapServer.SiteDataImpl.HandleChangesEx(String xmlInput) at Microsoft.SharePoint.SoapServer.SiteDataImpl.GetChangesEx(Int32 version, String xmlInput) at Microsoft.SharePoint.SoapServer.SiteData.GetChangesEx(Int32 version, String xmlInput) at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values) at System.Web.Services.Protocols.WebServiceHandler.Invoke() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() at System.Web.Services.Protocols.SyncSessionlessHandler.ProcessRequest(HttpContext context) at System.Web.Script.Services.ScriptHandlerFactory.HandlerWrapper.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error) at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

The service did not respond to the start or control request in a timelyfashion. (2147943453, 8007041d)

IIS version 7.5.7600.16385

After a server restart , when we do IISReset , we get the error :



The service did not respond to the start or control request in a timely fashion.

(2147943453, 8007041d)



But all the app pools are restarted successfully.

The eventvwr says that w3svc is started but asp performance counters could not be started successfully . Even though performance counters do work fine !!!!!!!!

What could be the reason , or where to start searching the cause ?

Resolution :

Reference : http://forums.iis.net/post/1883534.aspx and
http://support.microsoft.com/default.aspx?scid=kb;en-us;327649

You may also like:

get last app pool recycle timings

MSDTC encountered an error (HR=0x80000171) while attempting toestablish a secure connection with system

The Microsoft Distributed Transaction Coordinator service (MSDTC) tracks all parts of the transactions process, even over multiple resource managers on multiple computers. This helps ensure that the transaction is committed, if every part of the transaction succeeds, or is rolled back, if any part of the transaction process fails.



Sample error message :
Log Name: Application
Source: Microsoft-Windows-MSDTC Client 2
Date: x/xx/xxx xx:xx:xx xM
Event ID: 4879
Task Category: CM
Level: Warning
Keywords: Classic
User: N/A
Computer: xxxxxxx
Description:
MSDTC encountered an error (HR=0x80000171) while attempting to establish a secure connection with system HostNameOfCurrentServer.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-MSDTC Client 2" Guid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx0363}" EventSourceName="MSDTC Client 2" />
<EventID Qualifiers="32768">4879</EventID>
<Version>0</Version>
<Level>3</Level>
<Task>3</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime=”xxxx-xx-xxTxx:xx:xx.xxxxxxxxxZ” />
<EventRecordID>2733365</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>Application</Channel>
<Computer>xxxx</Computer>
<Security />
</System>
<EventData>
<Data Name="param1">80000171</Data>
<Data Name="param2">HostNameOfCurrentServer</Data>
</EventData>
</Event>

Suggested Articles:
Troubleshooting Problems with MSDTC 
Problem with MSDTC
MSDTC - Error while attempting to establish a secure connection (Standalone)

You may also like:

The application-specific permission settings do not grant Local Launch permission…


The COM+ System Application service entered the running state.


The following fatal alert was generated: 10. The internal error…


MOSS 2007 Troubleshooting Guide

Question : what is arpirowupdater.hxx ?

In our uls logs , we are getting message :

Process : mssearch.exe (_x-_-_)
Thread ID : _x-_-_
Area : SharePoint Server Search
Category : Exceptions
Event ID : _-_-
Level : High

Message :

<Exception><HR>0x80040e2f</HR><eip>000007FEF5D0A4E7</eip><module>d:\office\source\search\native\gather\plugins\arpi\arpirowupdater.hxx</module><line>2430</line></Exception>

Please help us identify the root cause and resolution for this .

You may also like:

Search – One or more property databases have fragmented indices.


Search History in SharePoint 2010


Question : what is merge.cxx ?

Question : what is merge.cxx ?

In our uls logs , we are getting message :

Process : mssearch.exe (_x-_-_)
Thread ID : -x_-_-
Area : SharePoint Server Search
Category : IDXPIPlugin
Event ID : _-_-
Level : High

Message : [ad0-c-0 Po] A master merge was started because the catalog reached the maximum number of indexes on the last level (16). [merge.cxx:2709] d:\office\source\search\native\ytrip\tripoli\cindex\merge.cxx (0x0DBC) 0x2D50 SharePoint Server Search IDXPIPlugin e130 High [ad0-c-0 Po] A master merge was started because the catalog reached the maximum number of indexes on the last level (16). [merge.cxx:2709] d:\office\source\search\native\ytrip\tripoli\cindex\merge.cxx



Please help us identify the root cause and resolution for this .

You may also like:

SharePoint 2010 Enterprise Search | SharePoint Crawl Exceptional Behaviour


Search – One or more property databases have fragmented indices.


Search History in SharePoint 2010