When we read recently that the 2020 census will be the first one conducted largely online instead of by mail, our first thought was, “Now what could possibly go wrong with that?” Interference by Russian hackers, as in the 2016 presidential election? Data breaches on a massive scale, such as in the Equifax disaster? Technological malfunctions, as in the rollout of the health insurance exchanges under the Affordable Care Act?

Well, sure. But as The New York Times reported earlier this month, more immediate challenges include chronic underfunding of the Census Bureau by Congress, cost overruns related to the transition to digital enumeration, and the potential for political meddling by the Trump administration in what has always been a rigorously nonpartisan agency. Further complicating the bureau’s task are several social trends that make its job harder than ever: an increasingly diverse population; proliferation of non-traditional living arrangements; and concerns about information security and privacy that result in lower response rates for the bureau’s surveys.

Experts worry that some combination of these factors could compromise the accuracy of the national head count, which is required to take place every 10 years under Article 1 of the U.S. Constitution.

The stakes are every bit as high as the degree of difficulty in locating and accurately counting an estimated 325 million people in 126 million households. Census data are used to apportion the number of seats each state has in the U.S. House of Representatives; to define the boundaries of congressional and state legislative districts; to allocate an estimated $675 billion in federal funds annually among local communities; to calculate unemployment, crime and poverty rates; and to issue health and education data. The private sector also depends on accurate census data. Businesses large and small use demographic information to help guide decisions about where to locate or to make investments.

Congress mandated in 2014 that the 2020 census should cost no more than the $13 billion spent on the 2010 tally, without adjusting for inflation. It then cut from the budget requests made by the Obama administration under the cap. Upon arrival, the Trump administration further tightened the screws. Under these constraints, the bureau’s shift to an online head count is aimed at saving money by reaching households more efficiently than with mailed forms, thus shrinking the vast number of enumerators sent out to track down those who fail to fill out their census forms.

Perhaps predictably, congressional parsimony up front has led to later cost overruns in making the shift to digital, including $300 million for centralized data processing services, according to the Times. And the bureau has had to cancel two of three trial runs of the new census process that would have tested its efficacy in rural areas where internet service is often spotty or unreliable. The history of technology systems that have not been thoroughly tested suggests that this could be a calamity.

On top of that, President Trump’s declared antipathy to immigrants and the administration’s broad-based efforts to undermine public trust in the data compiled by government institutions make it likely that immigrants both legal and undocumented will be less likely to participate in the census. That surely will be the case if the bureau is forced to adopt Trump’s suggestion that the survey include a question about citizenship or immigration status. A systematic undercount of the nation’s 11 million undocumented immigrants could result.

Equally troubling to census experts and civil liberties advocates alike is the possibility that the president will appoint Thomas Brunell, a Texas political science professor without relevant management experience, to be the bureau’s deputy director, who has operational oversight of the census. Brunell’s main qualifications for the job seem to be that he has served as an expert witness for Republican defendants in several gerrymandering cases and has been a critic of established statistical methods that adjust census results for population groups that are historically undercounted.

All this has the ring of a debacle in the making — one that could disrupt core government functions for a decade. Congress should make getting the 2020 census back on track one of its highest priorities and move to ensure that its nonpartisan character is preserved. In various forms, census data provide a key way for Americans to understand who they are as a people and how they are evolving. That understanding would be fatally undermined by a census whose reliability was in doubt or whose impartiality was open to question.