Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modelgen issues with schema 8.30: database validation error (14): Mapper Error #348

Open
gavmckee80 opened this issue Jan 21, 2023 · 1 comment

Comments

@gavmckee80
Copy link

After using modelgen to generate the go code for interacting with ovsdb I get the following errors

2023/01/21 17:47:43 database validation error (14): Mapper Error. Object type ovsmodel.CTZone contains field TimeoutPolicy (*string) ovs tag timeout_policy: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.Port contains field BondActiveSlave (*string) ovs tag bond_active_slave: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.Bridge contains field AutoAttach (*string) ovs tag auto_attach: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.FlowTable contains field FlowLimit (*int) ovs tag flow_limit: Wrong type, column expects []int. Mapper Error. Object type ovsmodel.OpenvSwitch contains field DbVersion (*string) ovs tag db_version: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.Manager contains field ConnectionMode (*string) ovs tag connection_mode: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.FlowSampleCollectorSet contains field IPFIX (*string) ovs tag ipfix: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.Mirror contains field OutputPort (*string) ovs tag output_port: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.Interface contains field AdminState (*string) ovs tag admin_state: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.Queue contains field DSCP (*int) ovs tag dscp: Wrong type, column expects []int. Mapper Error. Object type ovsmodel.Controller contains field ConnectionMode (*string) ovs tag connection_mode: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.IPFIX contains field CacheActiveTimeout (*int) ovs tag cache_active_timeout: Wrong type, column expects []int. Mapper Error. Object type ovsmodel.SFlow contains field Agent (*string) ovs tag agent: Wrong type, column expects []string. Mapper Error. Object type ovsmodel.NetFlow contains field EngineID (*int) ovs tag engine_id: Wrong type, column expects []int

My code is very simple

package main

import (
	"context"
	"log"

	generated "github.com/gavmckee80/bootstrap/ovsmodel"
	"github.com/ovn-org/libovsdb/client"
	//"github.com/ovn-org/libovsdb/model"
)

func main() {

	dbModel, err := generated.FullDatabaseModel()
	if err != nil {
		log.Fatal(err)
	}

	ovs, err := client.NewOVSDBClient(dbModel, client.WithEndpoint("unix:/var/run/openvswitch/db.sock"))
	if err != nil {
		log.Fatal(err)
	}
	err = ovs.Connect(context.Background())
	if err != nil {
		log.Print(err)
	}
	defer ovs.Disconnect()

The db schema I used was from OVS 2.17.6 (8.3.0)

ovs-vsctl (Open vSwitch) 2.17.6
DB Schema 8.3.0

Can someone help me here?

@blacob
Copy link

blacob commented Jan 24, 2023

This issue should've been resolved by 5001262, but this hasn't been included in a release yet.

go install github.com/ovn-org/libovsdb/cmd/modelgen@19d82f4 to try with the latest modelgen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants