We classify symmetry fractionalization and anomalies in a (3+1)d U(1) gauge theory enriched by a global symmetry group G. We find that, in general, a symmetry-enrichment pattern is specified by four pieces of data: ρ, a map from G to the duality symmetry group of this U(1) gauge theory which physically encodes how the symmetry permutes the fractional excitations, ν ∈ H 2 ρ [G, U T (1)], the symmetry actions on the electric charge, p ∈ H 1 [G, Z T ], indication of certain domain wall decoration with bosonic integer quantum Hall (BIQH) states, and a torsor n over H 3 ρ [G, Z], the symmetry actions on the magnetic monopole. However, certain choices of (ρ, ν, p, n) are not physically realizable, i.e., they are anomalous. We find that there are two levels of anomalies. The first level of anomalies obstruct the fractional excitations being deconfined, thus are referred to as the deconfinement anomaly. States with these anomalies can be realized on the boundary of a (4+1)d long-range entangled state. If a state does not suffer from a deconfinement anomaly, there can still be the second level of anomaly, the more familiar 't Hooft anomaly, which forbids certain types of symmetry fractionalization patterns to be implemented in an on-site fashion. States with these anomalies can be realized on the boundary of a (4+1)d short-range entangled state. We apply these results to some interesting physical examples.