<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom"><id>https://vic.demuzere.be/articles/tags/combell/atom.xml</id><title>Vic Demuzere - Combell</title><link href="https://vic.demuzere.be/articles/tags/combell/atom.xml" rel="self" type="application/atom+xml" /><link href="https://vic.demuzere.be/articles/tags/combell/" rel="alternate" type="text/html" /><updated>2025-03-04T17:41:55+00:00</updated><author><name>Vic Demuzere</name></author><entry><id>https://vic.demuzere.be/articles/pxc-cluster-innodb-page-size/</id><title>You can't change innodb_page_size on PXC clusters</title><link href="https://vic.demuzere.be/articles/pxc-cluster-innodb-page-size/" rel="alternate" /><updated>2025-03-04T18:14:32+00:00</updated><published>2025-03-04T17:41:55+00:00</published><content type="html"><![CDATA[<p>Today, I worked on a ticket for a customer with a <a href="https://craftcms.com" title="Craft CMS">Craft 4.x</a> CMS that created a MySQL table with a staggering 270 columns.
Most of them were of type <code>TEXT</code>, but it also contained about 50 <code>VARCHAR</code> columns of varying lengths.
Attempting to import the table resulted in a <em>Row Size Too Large</em> error.</p>
<pre><code>ERROR 1118 (42000): Row size too large (&gt; 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
</code></pre>
<h2 id="initial-attempts">Initial attempts<a href="#initial-attempts" aria-label="Link to heading 'Initial attempts'" data-heading-content="Initial attempts" class="anchor"></a></h2>
<p>The first attempt to resolve the issue involved converting all columns to <code>TEXT</code>, as their contents <a href="https://dev.mysql.com/doc/refman/8.4/en/storage-requirements.html#data-types-storage-reqs-strings" title="MySQL string type storage requirements">are stored off-page</a>. That didn't work: there were too much columns, and even the references consumed too much space.</p>
<p>Next, I considered <a href="https://dev.mysql.com/doc/refman/8.4/en/innodb-row-format.html" title="InnoDB row formats">changing the row format</a>, which can sometimes resolve this issue. Unfortunately, the customer had already set it to <code>DYNAMIC</code>, the best available option for this scenario. No gains there.</p>
<h2 id="innodb-page-size">InnoDB page size<a href="#innodb-page-size" aria-label="Link to heading 'InnoDB page size'" data-heading-content="InnoDB page size" class="anchor"></a></h2>
<p>The obvious fix for running out of space is creating more space.
MySQL has an <a href="https://dev.mysql.com/doc/refman/8.4/en/innodb-parameters.html#sysvar_innodb_page_size" title="InnoDB page size"><code>innodb_page_size</code></a> parameter that defines the tablespace's <em>page size</em>.
The data file consists of virtual pages, which are completely overwritten each time a change is made.</p>
<p>MySQL stores two rows in a page, meaning that when you update one, you're effectively saving two.
This is an important setting for performance, but in this case, it's relevant for another reason: <strong>a row can use at most half of the InnoDB page size</strong>.</p>
<p>The <code>innodb_page_size</code> setting is somewhat misleading because its value is stored inside the <code>ibdata1</code> file, which contains your MySQL data. Once the first page has been written, <strong>you can't change the value anymore</strong>.
All pages inside the file must be the same size.</p>
<p>Thus, changing it means <strong>recreating everything</strong>, which involves a process like this:</p>
<pre><code class="language-bash">mysqldump --all-databases &gt; backup.sql
systemctl stop mysql
rm -rf /var/lib/mysql/*
mysqld --user mysql --initialize --innodb-page-size=32K
systemctl start mysql
cat backup.sql | mysql
</code></pre>
<p>However, on our <strong>Percona PXC cluster</strong>, I was met with an error:</p>
<pre><code>2025-03-04T13:50:32.929013Z 0 [ERROR] [MY-010872] [InnoDB] InnoDB: Invalid page size=32768.
</code></pre>
<p>That was surprising, as <a href="https://dev.mysql.com/doc/refman/8.4/en/innodb-parameters.html#sysvar_innodb_page_size" title="InnoDB page size">the documentation</a> lists <code>32768</code> (<code>32K</code>) as a valid option.</p>
<h3 id="the-real-problem">The real problem<a href="#the-real-problem" aria-label="Link to heading 'The real problem'" data-heading-content="The real problem" class="anchor"></a></h3>
<p>I spent way too much time debugging this because the error message didn't lead to any useful documentation.
It turns out that <strong>Percona PXC cluster does not allow changing <code>innodb_page_size</code></strong>.
They only accept the default value of <code>16K</code>, and any other setting will fail.</p>
<p>From (an older) <a href="https://docs.percona.com/legacy-documentation/percona-xtradb-cluster/Percona-XtraDB-Cluster-5.6.51-28.pdf" title="Percona PXC cluster manual">Percona PDF manual</a>:</p>
<blockquote>
<p>Only the default 16 KB page size (innodb_page_size=16384) is accepted until the relevant upstream bug is fixed by Codership (see https://github.com/codership/galera/issues/398).
All other sizes will report <em>Invalid page size</em> and shut down (the server will not start up).</p>
</blockquote>
<p>Newer documentation doesn't seem to mention this anymore, but it still applies.</p>
<h2 id="watch-out-with-innodb_strict_mode">Watch out with <code>innodb_strict_mode</code><a href="#watch-out-with-innodb_strict_mode" aria-label="Link to heading 'Watch out with innodb_strict_mode'" data-heading-content="Watch out with innodb_strict_mode" class="anchor"></a></h2>
<p>While researching this issue, I found many Stack Overflow posts suggesting that disabling <code>innodb_strict_mode</code> might help. Be <strong>very</strong> careful with this!</p>
<p>Disabling strict mode <strong>only replaces the critical error with a warning</strong>. You'll be able to create the table, but the underlying issue remains: <strong>the rows are still too large</strong>.</p>
<p>It may not fail immediately, but at some point, an <code>INSERT</code> or <code>UPDATE</code> operation will trigger an error if it exceeds the maximum size. This shifts the failure from a controlled event (such as during deployment) to a random action that a user might perform — not ideal.</p>
<div class="footer"><hr><p>Thanks for subscribing to my feed!</p><p>Feel free to e-mail comments or corrections to <a href="mailto:vic@demuzere.be?subject=RE%3A%20You%20can%27t%20change%20innodb_page_size%20on%20PXC%20clusters">vic@demuzere.be</a>.</p></div>]]></content></entry><entry><id>https://vic.demuzere.be/articles/matching-public-private-key/</id><title>Check whether public and private key match</title><link href="https://vic.demuzere.be/articles/matching-public-private-key/" rel="alternate" /><updated>2025-02-07T10:59:22+00:00</updated><published>2025-02-06T21:00:00+00:00</published><content type="html"><![CDATA[<p>Customers regularly send me x509 key pairs at work<sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup>.
Most of the time these have been forwarded a few times already, and people tend to mess up the files.
This means that the public and private keys don't match anymore, and I have to ask for a new pair.</p>
<p>Luckily, we can use OpenSSL to check whether a public and private key match.</p>
<h2 id="for-rsa-keys">For RSA keys<a href="#for-rsa-keys" aria-label="Link to heading 'For RSA keys'" data-heading-content="For RSA keys" class="anchor"></a></h2>
<p>The classic way to compare RSA keys is to check whether the <strong>modulus</strong> is the same, as this is the only part that is shared between the public and private keys.
If the modulus isn't the same, the keys can't form a pair.</p>
<p>Read the modulus from the <strong>public key</strong>:</p>
<pre><code>openssl rsa -pubin -in public.pem -modulus -noout | openssl sha1
</code></pre>
<p>Then do the same with the <strong>private RSA</strong> key:</p>
<pre><code>openssl rsa -in private.pem -modulus -noout | openssl sha1
</code></pre>
<p>If the two values match, the key files form a pair.</p>
<p>Note that we're piping the actual output of the <code>-modulus</code> command to <code>openssl sha1</code> to get a shorter hash of the modulus.
This makes it easier to manually compare the two values, but it's not strictly necessary.
You could also compare the output directly if you're feeling brave.</p>
<h2 id="for-ec-keys">For EC keys<a href="#for-ec-keys" aria-label="Link to heading 'For EC keys'" data-heading-content="For EC keys" class="anchor"></a></h2>
<p>Elliptic curve keys don't have an easy-to-compare modulus like the RSA keys above had.
However, it's always possible to generate the public key<sup class="footnote-ref"><a href="#fn-2" id="fnref-2" data-footnote-ref>2</a></sup> part when we have the private key.</p>
<p>Using the <strong>private key</strong>, generate (a hash of) the public key:</p>
<pre><code>openssl pkey -pubout -in private.pem | openssl sha1
</code></pre>
<p>Then compare the output with the <strong>public key</strong> file you have.
We need to make <code>openssl</code> load it and print it out again to make sure we get the exact same format.</p>
<pre><code>openssl x509 -pubkey -in public.pem -noout | openssl sha1
</code></pre>
<p>If the two values match, these keys form a pair.</p>
<section class="footnotes" data-footnotes>
<ol>
<li id="fn-1">
<p>Please don't do this. Ask the company that needs a certificate to generate a private key and provide you with a <a href="https://en.wikipedia.org/wiki/Certificate_signing_request">Certificate Signing Request (CSR)</a>. This way, you don't have to handle the private key at all. <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p>
</li>
<li id="fn-2">
<p>When people say &quot;public key&quot; in the context of a x509 pair they usually refer to the certificate. The public key we're extracting here is the actual cryptographic public key, it doesn't contain the extra data like domain names that a certificate usually holds. You can't recover the full certificate when you only have the private key. <a href="#fnref-2" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2">↩</a></p>
</li>
</ol>
</section>
<div class="footer"><hr><p>Thanks for subscribing to my feed!</p><p>Feel free to e-mail comments or corrections to <a href="mailto:vic@demuzere.be?subject=RE%3A%20Check%20whether%20public%20and%20private%20key%20match">vic@demuzere.be</a>.</p></div>]]></content></entry><entry><id>https://vic.demuzere.be/articles/easy-ssh-connections-combell-shared-hosting/</id><title>Easy SSH connections to Combell shared hosting</title><link href="https://vic.demuzere.be/articles/easy-ssh-connections-combell-shared-hosting/" rel="alternate" /><updated>2023-11-28T19:55:32+00:00</updated><published>2019-12-16T12:13:30+00:00</published><content type="html"><![CDATA[<p>When trying to connect over SSH to your <a href="https://www.combell.com/en/hosting/web-hosting" title="Combell shared hosting">Combell shared hosting</a> account, the control panel explains how to connect using one of these two options:</p>
<ul>
<li><code>ssh yoursitebe@ssh.yoursite.be</code></li>
<li><code>ssh yoursitebe@ssh123.webhosting.be</code></li>
</ul>
<p>The first one <strong>may not work</strong> if your DNS records are not correct, the second one always works but is hard to remember.
With just a small change to our local SSH config, we can use a third option: <strong>simply connect to your domain name</strong>!</p>
<ul>
<li><code>ssh yoursite.be</code></li>
</ul>
<p>For this to work we have to tell <code>ssh</code> what to do with <code>yoursite.be</code>.</p>
<h2 id="the-local-ssh-config-file">The local SSH config file<a href="#the-local-ssh-config-file" aria-label="Link to heading 'The local SSH config file'" data-heading-content="The local SSH config file" class="anchor"></a></h2>
<p>On computers running Linux and macOS, the configuration file can be found at:</p>
<pre><code>~/.ssh/config
</code></pre>
<p>The file (or the <code>.ssh</code> directory) may not exist yet, you can create it manually.</p>
<p>Inside the file you can specify <code>Host</code> blocks to tell the SSH client what to do with certain hostnames.
We'll use our domain name as that's the natural address to connect to when we want to update our website.</p>
<pre><code>Host yoursite.be
	HostName ssh123.webhosting.be
	User yoursitebe

Host othersite.com
	HostName ssh472.webhosting.be
	User othersitecom
</code></pre>
<p>The correct values for the <code>HostName</code> and <code>User</code> parameters can be found after logging in to the <a href="https://my.combell.com" title="Combell control panel">My Combell control panel</a>.
Navigate to the correct web hosting account and click the <strong>SSH</strong> menu option on the left.
You'll see the <em>SSH host</em> and <em>SSH user name</em> listed there.</p>
<p>After saving the file, you can connect right away:</p>
<pre><code>ssh yoursite.be
Last login: Mon Dec 16 14:28:14 2019 from 178-221-32-24.access.telenet.be
yoursitebe@com-linssh123:~#
</code></pre>
<p>This also works when using <code>scp</code> or <code>rsync</code> to transfer files!</p>
<div class="footer"><hr><p>Thanks for subscribing to my feed!</p><p>Feel free to e-mail comments or corrections to <a href="mailto:vic@demuzere.be?subject=RE%3A%20Easy%20SSH%20connections%20to%20Combell%20shared%20hosting">vic@demuzere.be</a>.</p></div>]]></content></entry></feed>