Azure – increase Linux VM OS Disk size

I am using Azure Linux (Ubuntu) VM’s default OSDisk 30 GB, due to data and other files there was a need emerged to increase that size.

I went to Azure portal and it was straightforward to increase disk size. Shut down VM, alter Disk config to increase size, save and reboot machine.

But surprisingly nothing changed when i checked the size again using df -h

Then i started reading the documentation of Azure and came across below URL (see bottom ref section) which explained that Portal only create / modify size but you still have to do update of partition , modify of filesystem to reflect recent changes.

Also on my /dev/sda i was getting below error

GPT PMBR size mismatch (62914559 != 125829119) will be corrected by w(rite).

started reading on stack blogs and found the reason and solution for this GPT error. As we recently increased the size which was not completely utilized so system was complaining about it.

Below commands i performed to resolve my issue and they are pretty standard what i found when you have to work on Linux fs.

Continue reading “Azure – increase Linux VM OS Disk size”

Error: socket hang up

While working with Node.js microservice that had some long-running request/queries, I needed a way to increase the request timeout for the Express application.

It is not clearly defined in documentation and not at all, in the Express documentation so here’s how you do it.

Simply put, you need to configure the timeout value on the HTTP Server that express generates when you call the listen method.

Continue reading “Error: socket hang up”

Https SSL cert name mismatch warning – “The security certificate presented by this website was issued for a different website’s address.”

Recently I was working on one project and encountered an Interesting issue related to SSO server’s SSL Cert where it was complaining about being used for a domain name other than it was registered for.

During investigation it was revealed that there are two domain names are configured with same IP. Cert was generated with alias name, hence it was complaining when we call the primary URL which was not listed in that cert.

What that meant is, let say – you have a self-signed cert for local domain “localhost” but you trying to use it for “test.nits.com” as well and both pointing to same IP address for example “127.0.0.1”.

When we trying to call localhost it works fine, as cert have it listed.

When we trying to use other local domain, it giving warning

So what is the problem here with SSO call, as this is just a warning ?

So when we try to call this HTTPS domain where name is mismatching in cert, Async call from project is getting rejected with below error, saying certificate is invalid as per validation procedures.

System.Net.Http.HttpRequestException
Continue reading “Https SSL cert name mismatch warning – “The security certificate presented by this website was issued for a different website’s address.””

Node-sass module issues while working with private npm registry or artifactory like JFrog

Node-sass is one of famous library used by Node Js projects now days. Nodesass is a library that provides binding for Node.js to LibSass, the C version of the popular stylesheet preprocessor,Sass. It allows you to natively compile .scss files to css at incredible speed and automatically via a connect middleware.
When you install this library it download binary as per the machine on which you are running it.

Like if you are on a windows machine 64 bit architecture, it will try to download
“win32-x64-57_binding.node” and different binary in case of other OS.

It works all fine when you are on a machine where you have no internet restrictions in term of opening a site like in this case these binaries are located on GITHUB. So if you have access to github you will see ‘npm install’ going smooth.

But what if your organization mandates to use private artifactory solution like JFrog and have no access to Github ??

npm install complaining about unable to download binary and suggesting to use proxy

Don’t worry we have solution for this =)

I am going to tell you two ways to tackle this situation, one for old version of node-sass like nodes-sass@4.5.3 (it was in my case) and one is for latest versions which are more configurable.

Continue reading “Node-sass module issues while working with private npm registry or artifactory like JFrog”

“The page is performing an async postback but the ScriptManager.SupportsPartialRendering property is set to false. Ensure that the property is set to true during an async postback” OR “Invalid postback or callback argument”

Recently I was working on performance testing for one of my application and  came across this issue where all of my call failing in JMeter.

I started analyzing and found it was a wizard where series of calls were on same page using ASYNC Ajax calls which were complaining “The page is performing an async postback but the ScriptManager.SupportsPartialRendering property is set to false. Ensure that the property is set to true during an async postback”  due to which my main POST was failing with error “Invalid postback or callback argument”.

The strange thing was all of this was working fine when run via UI. Then started reading about when this error occurs and came across one discussion on a forum where they mentioned about SupportsPartialRendering is not supported by every browser

Continue reading ““The page is performing an async postback but the ScriptManager.SupportsPartialRendering property is set to false. Ensure that the property is set to true during an async postback” OR “Invalid postback or callback argument””

Google Cloud Platform : Enable Authentication with SSH and Password using AuthenticationMethods option

Here I am going to explain, how to enable Key and Password based authentication in linux instances of Google Cloud. This can be applied on other Cloud or standalone Linux instances. But do check manuals 🙂

When i say Key + Password, I am not referring passphrase which we give while created Private/Publich SSH key. I am referring to multiple auth methods where system will be first authenticated via PubKey and then via Password.

If your Pubkey is not matching it won’t allow you to login. If password not matching then also it won’t allow you to login. You must use exact same credentials which you configured.

I am not explaining here how to create SSH keys or password, I am assuming you already know that.

Continue reading “Google Cloud Platform : Enable Authentication with SSH and Password using AuthenticationMethods option”

Oracle Constraint Exceptions

ADD/ENABLE constraint exception like ORA-02437, ORA-02299 etc

Today while working on one assignment I came across situation where I have to enable a unique key constraint on the table which some one disabled and forget due to which many duplicate records get entered and started creating problem for the application.

Now challenge is to find out all those records there are ways to  find duplicates by writing some queries but this is easiest and faster way by using Oracle Exceptions table.

Continue reading “Oracle Constraint Exceptions”

com.jcraft.jsch.JSchException: reject HostKey: serverName

Today I was working on a Ant target to upload file to server using SCP task which using jsch-0.1.49.jar API. Below is the syntax for same in Ant build.xml. You need to add the API file in class path.

<target name=”copyFileToServer”>
        <echo>::::::::copyFileToServer Example::::::::::::</echo>
    <scp file=”Sample.txt” todir=”${svn.username}:${svn.password}@${hostname}:/tmp/” verbose=”true” port=”2222″  failonerror=”true”/>
  </target>

When I tried this I faced “reject HostKey” error. Reason of error was server was not listed in my known hosts list. So in order to fix this you have two options either add that server to known host list or

Continue reading “com.jcraft.jsch.JSchException: reject HostKey: serverName”