The authors examine the problem of scheduling n jobs with a common due date on a single machine. The processing time of each job is a random variable, which follows an arbitrary distribution with a known mean and a known variance. The machine is not reliable; it is subject to stochastic breakdowns. The objective is to minimize the expected sum of squared deviations of job completion times from the due date. Two versions of the problem are addressed. In the first one the due date is a given constant, whereas in the second one the due date is a decision variable. In each case, a general form of the deterministic equivalent of the stochastic scheduling problem is obtained when the counting process related to the machine uptime distribution is a generalized Poisson process. A sufficient condition is derived under which optimal sequences are V-shaped with respect to mean processing times. Other characterizations of optimal solutions are also established. Based on the optimality properties, algorithms with pseudopolynomial time complexity are proposed to solve both versions of the problem.