Error while setting up Meshery locally

I was trying to setup Meshery locally on windows, here are the sequence of commands I ran, with logs:

  1. make ui-setup
  2. make ui-build
  3. make server

I have ensured that I’m using Node 18 and Golang 1.21.1 version.

I ran all of the above commands in the root directory of the repository.

The make server is giving me following error:

$ make server
fatal: No names found, cannot describe anything.
cd server; cd cmd; go mod tidy; \
BUILD="" \
PROVIDER_BASE_URLS="https://cloud.layer5.io" \
PORT=9081 \
DEBUG=true \
APP_PATH="./apps.json" \
KEYS_PATH="../../server/permissions/keys.csv" \
go run main.go error.go;
INFO[2024-12-05T01:11:22+05:30] Local Provider capabilities are: Not Set      app=meshery
INFO[2024-12-05T01:11:22+05:30] Meshery Server release channel is: Not Set    app=meshery
INFO[2024-12-05T01:11:22+05:30] Meshery Database is at: /home/zopsss/.meshery/config  app=meshery
INFO[2024-12-05T01:11:22+05:30] Using kubeconfig at: /home/zopsss/.kube       app=meshery
INFO[2024-12-05T01:11:22+05:30] Log level: debug                              app=meshery
ERRO[2024-12-05T01:11:22+05:30] msg[Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub]  app=meshery
ERRO[2024-12-05T01:11:22+05:30] Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub  app=meshery code=meshery-server-1349 probable-cause="Possible causes include incorrect database file path, invalid database engine configuration, or insufficient permissions." severity=2 short-description="Unable to initialize database handler" suggested-remediation="Verify the database file path and ensure it is correct. Check the database engine configuration and ensure the application has the necessary permissions to access the database file."
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x9e3c72]

goroutine 1 [running]:
gorm.io/gorm.(*DB).getInstance(0x410825?)
        /home/zopsss/go/pkg/mod/gorm.io/gorm@v1.25.12/gorm.go:406 +0x12
gorm.io/gorm.(*DB).Migrator(0x410ba5?)
        /home/zopsss/go/pkg/mod/gorm.io/gorm@v1.25.12/migrator.go:12 +0x13
gorm.io/gorm.(*DB).AutoMigrate(0x0?, {0xc000328bd0, 0x7, 0x7})
        /home/zopsss/go/pkg/mod/gorm.io/gorm@v1.25.12/migrator.go:24 +0x25
github.com/layer5io/meshkit/models/meshmodel/registry.NewRegistryManager(0x58577f0)
        /home/zopsss/go/pkg/mod/github.com/layer5io/meshkit@v0.7.87/models/meshmodel/registry/registry.go:57 +0x22f
main.main()
        /mnt/c/OpenSource/meshery/server/cmd/main.go:183 +0x127f
exit status 2
make: *** [Makefile:162: server] Error 1

I tried to find solution in the existing topics but it seems like no had similar kind of issue. It’d be very helpful if someone can solve this problem, thanks in advance :slight_smile:

Hi @Zopsss, try the following steps:

  • Go to your meshery folder in your local-system where you’ve cloned it. Execute:
  • git remote add upstream https://github.com/meshery/meshery
  • git fetch upstream
  • Restart the meshery server
  • Additionally, before restarting the server, if you like to pull the latest changes, you can do: git pull upstream master

After completing these steps, try running the make commands again.

Are you using WSL2? Whether you are or are not, I suspect that these instructions could use with some updating - Setting up Meshery Development Environment on Windows | Meshery. We can safely remove the WSL1 instructions from these contributing docs, too.

Meshery’s use of go-sqlite3, means that you’ll likely need to follow these steps during the build process:

  1. Set the CGO_ENABLED=1 environment variable to enable cgo support:
    $ export CGO_ENABLED=1
  2. Ensure you have a C compiler (e.g., GCC) installed and available in your system’s PATH.
  3. Try make server again.

If this works, then we we’ll want to update the Windows contributing docs.

Thanks for the reply, Yes I’m using WSL2.

I added the main repo of Meshery as upstream and did the git fetch upstream and git pull upstream master as @Yash_Sharma suggested.

Then I ran the export CGO_ENABLED=1 and installed the gcc compile as @Lee suggested.

I tried running the make server command again and make ui command. After running make server command, the server started at port 9081.

This morning, after running make server, on port 9081, I was getting following page:

After clicking on the Meshery option, it redirected me to some cloud.layer5.io page, sorry I don’t have screenshot of it so I cannot show it to you.

But now, when I try to run make server command, it gives me following error:

Not sure why this is happening.

Also after running make ui command, I get this error:

PS: both these commands takes really long time to run, is there any faster way to start both backend server and UI?

@Zopsss Thanks for sharing the update. do you mind checking this Mershey Server gives 404 after selecting Mershery as a provider - #12 by Loveyfin00

Hey @Yash_Sharma, really sorry for the late reply, I was quite busy last week.

I checked your suggested post but there was no answer provided for the 404 error page problem.

It would be really helpful if you can assist me further more.