Was it before 1939? or was the invasion of Poland a surprise?
The invasion of Poland didn't come out of a clear blue sky, if that's what you're asking. Obviously, Austria, the Sudetenland and then the rest of the modern Czech Republic had already been annexed and from March 1939 onwards Hitler had started making noises about Germany's right to Danzig (the port city now known as Gdansk, which was a neutral "free city" but vital to Poland's economy). Poland had made it clear that she would not surrender - Foreign Minister Jozef Beck made a firebreathing speech in May saying
"Peace is a precious and a desirable thing. Our generation, bloodied in wars, certainly deserves peace. But peace, like almost all things of this world, has its price, a high but a measurable one. We in Poland do not know the concept of peace at any price. There is only one thing in the lives of men, nations and countries that is without price. That thing is honor."
And Britain and France made treaties promising to aid Poland if she was invaded.
Now, a lot of people hoped this would be enough to contain Hitler, that standing up and saying "No, this line you do not cross" would make him back down. A lot of other people thought that Hitler needed dealing with, and soon. Some thought that the latter group were dangerous warmongers who wanted to inflict the horrors of WW1 on another generation - Churchill was the public face of the "hawks" in the UK - while some thought the peacemakers were deluded fools who were sticking their head in the sand to avoid unpleasant truths - British PM Chamberlain was the poster child for the "doves".
Either way, there was a growing sense of crisis during 1939 and it was clear that something was going to have to happen, but there was a good argument that Hitler would not go to war against three allied nations all on his own (four if you count Romania) and that nobody really wanted a war because enough people remembered 14-18.
I don't think anybody can have known that "World War 2" as we know it was going to happen, though. It seems to have been accepted as a given on both sides of the debate in the UK at least that Hitler had seized power like a gangster, had no real popular support and would be toppled by his own people as soon as he was discredited by being forced to back down over Danzig, or at worst with a naval blockade and leaflet campaign if war did come, with France's magnificent Maginot Line keeping them all penned up and unable to break out of the encirclement.