You do not show details, but an indefinite integral always involves an arbitrary constant (${}+C$). So the calculation quite likely is correct, and a contradiction has not been reached. A problem of a similar character is common when integrating trigonometric functions. One does the integral in two different ways, and gets two different answers. However, in such situations, the answers differ by a constant, so can be both correct.
However, unfortunately the result indicates that one has made no progress towards finding the answer. This sort of thing happens moderately often in attempted integrations by parts. After some calculations, one reaches the conclusion that the integral is equal to $\dots$ the integral.
Remark: I do not think integration by parts can play a useful role here. Let $u=\log x$. Then $du=\frac{dx}{x}$, so in one step we get to $\int\frac{du}{u}$. Thus our integral is $\log(|\log x|)+C$.