TITLE: extension of $G$-bundles
QUESTION [12 upvotes]: Let $S$ be a smooth surface (let's say over an algebraically closed field) and let $D$ be a smooth divisor in $S$. Let also $G$ be a connected algebraic group. Assume that we are given a principal $G$-bundle ${\mathcal F}$ on $S\backslash D$. Under what conditions can we extend it to all of $S$? Do I understand correctly, that this is always the case when the derived
group $[G,G]$ is simply connected?

REPLY [7 votes]: Nick Shepherd-Barron once asked me this question, and I think I can remember what was eventually concluded. 
The short answer to the original question is negative for the additive group $\mathbb{G_a}$. Map $SL_2(\mathbb{C})$ to $X=\mathbb{C}^2-(0,0)$ by letting a matrix act on the vector $(1,0)^T$. This realizes the group as a torsor over $X$ for the group of unipotent matrices
\[
\begin{pmatrix} 1 & a \\\\ 0& 1 \end{pmatrix}.
\]
We can trivialize it over the vectors $(v_1,v_2)^T$ with $v_1\neq 0$ with the section
\[
\begin{pmatrix} v_1 & 0 \\\\ v_2& v_1^{-1} \end{pmatrix},\]
while it trivializes on the set $v_2\neq 0$ via the section
\[\begin{pmatrix} v_1 & -v_2^{-1} \\\\ v_2& 0 \end{pmatrix}.\]
The transition function on the overlap is easliy computed to be
\[\begin{pmatrix} 1 & (v_1v_2)^{-1}\\\\ 0& 1 \end{pmatrix}.\]
This represents the standard non-trivial generator of $H^1(O_X)$, and hence, the bundle is non-trivial. On the other hand, if you could extend it to $\mathbb{C}^2$,  it would trivialize, since there are no non-trivial $\mathbb{G}_a$-bundles on an affine variety.
There is indeed a correspondence between principal bundles and tensor functors from representations to vector bundles. But if I recall correctly, the functor  is required to be exact. In the case at hand, the extension of vector bundles is the direct image with respect to the inclusion $X\hookrightarrow \mathbb{C}^2$, which fails this.

Added: OK, I see this was just an elaborate way to say: take any principal $\mathbb{G}_a$-bundle corresponding to a non-zero element of $H^1(O_X)$. Note, anyways, that the derived group is trivial in this example. Certainly the statement is false for general connected groups, contrary to some of the comments.

Added, 25, November, 2011:
This question came back to me today while I was thinking about something unrelated. It occurred to me then to point out that for the example above, if we work in the analytic category, we have
$$H^1(X, \mathbb{G}_a)\simeq H^1(X, \mathbb{G}_m),$$
via the exponential sequence. On the other hand, 
$$H^1(\mathbb{C}^2, \mathbb{G}_a)=H^1(\mathbb{C}^2, \mathbb{G}_m)=0.$$
So the desired extension property is false on analytic spaces even for reductive structure groups.