First let us recall the following.
In the context of bounded linear operators, one says that $T$ is invertible if both $T$ and $T^{−1}$ are bounded linear operators.
Let
$$
D(T)=\lbrace \langle e_1,Te_1\rangle,\langle e_2,Te_2\rangle,\ldots \rbrace"="\lbrace T_{11},T_{22},\ldots\rbrace
$$
be the diagonal entries of the upper triangular matrix $T$ with respect to some orthonormal basis $(e_n)_{n\in\mathbb N}$ of $\ell_2(\mathbb N)$. In finite dimensions we know that
$$
D(T)=\sigma_p(T)=\sigma(T)
$$
no matter with regard to which orthonormal basis $T$ is upper triangular. Here $\sigma_p(T)$ is the point spectrum (eigenvalues) and $\sigma(T)$ is the whole spectrum of $T$. This is very useful since a non-zero diagonal directly tells us that $0$ is not in the spectrum so $T$ has to be invertible.
This is where the infinite dimensions come into play. Here we only have
$$D(T)\subset \sigma_p(T)\subset\sigma(T)$$
so the diagonal entries of upper triangular $T$ do not necessarily contain all the eigenvalues / elements of the spectrum so you can't directly read off if $T$ is invertible or not.
As an example, consider the left shift $S_L\in\mathcal B(\ell_2(\mathbb N))$ (bounded linear op. on $\ell_2$) which is upper triangular with respect to the standard basis where $D(T)=\lbrace 0,0,0,\ldots\rbrace$ as is readily verified. Note that $S_L$ has the open unit disk as point spectrum and the closed unit disk as whole spectrum so $S_L$ can't be invertible (in fact $S_L$ is surjective but not injective). However it is possible to find an orthonormal basis of $\ell_2(\mathbb N)$ such that $S_L$ is upper triangular and $0\notin D(S_L)=\lbrace \frac12,\frac12,\frac12,\ldots\rbrace$.
For the topic of triangular operators I recommend the paper "Triangular Operators" (1990) by D. Herrero - there I also took the example from.