Let $n=\prod p_i^{k_i}$, then we want $3^t=\sigma(n)=\prod \sigma(p_i^{k_i})=\prod 3^{t_i}$, and so we have to solve $\frac{p^{k+1}-1}{p-1}=3^t$ for prime $p$.
If $p=2$, we must have $2^{k+1}-1=3^t$, which by Mihailescu is only possible if $k=1$.
If $p>2$, by zsigmondy theorem LHS will have at least $\tau(k+1)-1$ distinct prime factors, which is impossible unless $\tau(k+1)-1=1\implies k+1$ is a prime $q$ such that $\frac{p^q-1}{p-1}=3^t$.
If $3|p-1$ then by LTE $v_3(LHS)=v_3(q)\leq 1$. In this case we must have $q=3$ and $t=1$, which implies $p^2+p+1=3$ which would be possible only for $p=1$.
If $3\nmid p-1$ then $q=ord_3(p)|3-1=2$ which implies $q=2$. In this case we need to have $p+1=3^t$, which is only possible if $p=2$ and $t=1$.
Therefore the only solution is $n=2$