The beer hall putsch of 1923 was a failed coup attempt. Hitler was arrested, charged and tried for treason and found guilty as was Rudolf Hess and the nazi party was outlawed in Bavaria. He did not serve all of his 5 year prison sentence but did write Mein Kampf in prison and it was published after his release.