This paper presents an online ascent trajectory optimization algorithm based on optimal control and convex optimization without accurate initial guesses. Due to the high complexity of space systems, exceptional cases such as engine failures may happen during the flight. In these cases, the dynamical model greatly changes and the nominal trajectory is infeasible. Thus, online trajectory optimization and replan should be considered when accurate initial guesses cannot be given. In this paper, the ascent trajectory optimization problem of launch vehicles is formulated as a Hamilton two-point boundary value problem (TPBVP) according to the optimal control theory. The control vector is expressed as a function of costate variables and the terminal condition is given according to the orbital constraint of the launch mission. In order to solve the TPBVP rapidly and accurately without accurate initial guesses, a convex approach is presented. Firstly, the flip-Radau pseudospectral method is applied to convert the continuous-time TPBVP into a finitedimensional equality constraint. Then, successive linearization is applied to formulate the problem as a series of iteratively solved second-order cone programming (SOCP) subproblems. Considering the accuracy and robustness of the algorithm, trust-region and relaxation strategy are applied. The convex trajectory optimization can be solved by Interior Point Method (IPM) automatically. Simulation results in the case of thrust loss are presented to show the accuracy, efficiency and robustness of the algorithm.