goharbor/harbor · error

invalid non-positive value for quota limit, value=

Error message

invalid non-positive value for quota limit, value=%v

What it means

ValidateQuotaLimit rejected a storage quota that is <= 0 but not the UNLIMITED sentinel (-1); zero and negative limits other than -1 are not valid quota values. Called from project quota Validate and config ValidateCfg.

Solutions

  1. Set the storage limit to -1 for unlimited
  2. Set the storage limit to a positive byte count
  3. Check the storage_per_project config or quota update payload for a 0/negative value
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/quota_storage_limit.go:26 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/9b928ce06cca1a7e. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/quota_storage_limit.go:26

//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package lib

import (
	"fmt"

	"github.com/goharbor/harbor/src/pkg/quota/types"
)

func ValidateQuotaLimit(storageLimit int64) error {
	if storageLimit <= 0 {
		if storageLimit != types.UNLIMITED {
			return fmt.Errorf("invalid non-positive value for quota limit, value=%v", storageLimit)
		}
	} else {
		// storageLimit > 0, there is a max capacity of limited storage
		if uint64(storageLimit) > types.MaxLimitedValue {
			return fmt.Errorf("exceeded 1024TB, which is 1125899906842624 Bytes, value=%v", storageLimit)
		}
	}
	return nil
}

View on GitHub (pinned to 7b2fd08cc5)