vitessio/vitess · error

invalid joined path

Error message

invalid joined path

What it means

When choosing a random serving tablet at keyspace scope, vtadmin requires at least one tablet with State == Tablet_SERVING in the keyspace. If none exist it logs the full list of tablets searched and returns this wrapped ErrNoServingTablet error.

Source

Thrown at go/fileutil/join.go:26

    http://www.apache.org/licenses/LICENSE-2.0

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 fileutil

import (
	"errors"
	"os"
	"path/filepath"
	"strings"
)

var ErrInvalidJoinedPath = errors.New("invalid joined path")

// SafePathJoin joins file paths using a rootPath and one or many other paths,
// returning a single absolute path. An error is returned if the joined path
// causes a directory traversal to a path outside of the provided rootPath.
func SafePathJoin(rootPath string, joinPaths ...string) (string, error) {
	allPaths := make([]string, 0, len(joinPaths)+1)
	allPaths = append(allPaths, rootPath)
	allPaths = append(allPaths, joinPaths...)
	p := filepath.Join(allPaths...)
	absPath, err := filepath.Abs(p)
	if err != nil {
		return p, err
	}
	absRootPath, err := filepath.Abs(rootPath)
	if err != nil {
		return absPath, err
	}
	if absPath != absRootPath && !strings.HasPrefix(absPath, absRootPath+string(os.PathSeparator)) {

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Bring up or re-enable at least one serving tablet in the keyspace
  2. Verify tablet states via vtctldclient GetTablets and correct any non-serving tablets
  3. Confirm vtadmin's cluster/cell discovery config points at the intended topology
Defensive patterns

Strategy: validation

Validate before calling

n := 0
for _, t := range tablets {
	if t.Tablet.Keyspace == ks && t.State == vtadminpb.Tablet_SERVING { n++ }
}
if n == 0 { return errors.New("keyspace has no serving tablets") }

Type guard

func hasServingTabletInKeyspace(tablets []*vtadminpb.Tablet, ks string) bool {
	for _, t := range tablets {
		if t.Tablet.Keyspace == ks && t.State == vtadminpb.Tablet_SERVING {
			return true
		}
	}
	return false
}

Prevention

When it happens

Trigger: Calling a keyspace-scoped RPC (e.g. GetSchema for a keyspace) where the filtered tablet list (keyspace match + SERVING state) is empty.

Common situations: All tablets in the keyspace are drained or down; vtadmin is pointed at the wrong cluster/cell; tablets are registered but never transitioned to serving.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/425d28221efe6390. Report an issue: GitHub.