[ent/SQLite3] insert nodes to table "users": near "RETURNING": syntax error

Problem If you use ent with sqlite3 driver in your Golang project, you may encounter the following error when you try to insert a new record to the table. insert nodes to table "users": near "RETURNING": syntax error Analysis The error message indicates that the sqlite3 driver does not support the RETURNING clause. If you are using Golang sqlite3 package github.com/mattn/go-sqlite3 in your project. The issue may be caused by the version of the package. ...

[Gitea] RewriteAllPublicKeys failed: open /data/.ssh/authorized_keys.tmp: permission denied

Gitea has recently released version 1.20.0, and I endeavored to upgrade my locally-hosted instance from version 1.17.0 to 1.20.0. During this process, I encountered the following error when attempting to execute the docker-compose file: routers/init.go:60:mustInit() [F] code.gitea.io/gitea/models/asymkey.RewriteAllPublicKeys failed: open /data/git/.ssh/authorized_keys.tmp: permission denied Received signal 15; terminating. This issue is not exclusive to the new version, as some users have reported similar problems when upgrading from older versions, such as 1.17.3 to 1.18.0. ...

[OCI/Swarm] How to Fix the "connect: no route to host" Error When Joining a Docker Swarm in OCI VM

Hey there, if you’re getting a super frustrating error when trying to join a Docker Swarm in Oracle Cloud Infrastructure (OCI) VM, then you’ve come to the right place! Here’s the error message you might see: Error response from daemon: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 132.12.23.123:2377: connect: no route to host" Yikes! But don’t worry, we’ve got some easy steps you can follow to fix it and get back to your Docker swarming in no time. ...

[OCI] Error: "iptables failed: iptables --wait -t filter -A DOCKER"

If you encounter the error messages shown below when attempting to run docker-compose up in OCI, a solution to the problem can be found in the following steps: failed to create network traefik_default: Error response from daemon: Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o br-5501386794d6 -j DOCKER: iptables v1.8.4 (legacy): Couldn't load target `DOCKER':No such file or directory Try `iptables -h' or 'iptables --help' for more information. (exit status 2) or ...

[WSL/Swarm] Fail to Join Docker Swarm as Worker

1. Problem I was trying to set up a Docker Swarm environment in my home network. My plan was to run the Docker Swarm manager node in a WSL2 Ubuntu distro on my Windows laptop, and run the Docker Swarm worker node on my MacMini. Both of them have Docker Desktop installed. When I tried to add a worker to the Swarm, I received the following error: Error response from daemon: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 192.168.65.3:2377: connect: connection refused" My operation is as followed below ...

[WSL] cgo: C compiler 'gcc' not found

When I first time built a Golang project from VS Code wsl mode, I got the below error: Build Error: go build -o /home/oscar/source/github.com/xx/xx/__debug_bin -gcflags all=-N -l . # runtime/cgo cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in $PATH (exit status 2) My first reaction for this error is to install the gcc compiler in my Windows environment. However, the solution is actually to install gcc compiler in the wsl environment. ...

[WSL] Could not access the service hosted in WSL from host by IP

If you just started to use WSL, you may encounter the issue that You only can access your service hosted in the WSL from the host by localhost, but not the IP address. For example, you have a web service that listens to port 8080. In your web browser, you can browse the site with http://localhost:8080, but http://127.0.0.1:8080. The reason is that you need to use the WSL IP address. An easy way to find the address is to execute the below command in WSL terminal. ...

[Golang] go get: fatal: could not read Username for 'xxx': terminal prompts disabled

1. Error 1: fatal: could not read Username for 'https://github.com': terminal prompts disabled The issue appears when I tried to download a private golang repository by the command go get github.com/oscarzhou/private-helloworld. The completed error shows as below: % go get github.com/oscarzhou/private-helloworld go: module github.com/oscarzhou/private-helloworld: git ls-remote -q origin in /Users/oscarzhou/go/pkg/mod/cache/vcs/c5fb5660c8bfa54f1b957fc4e651ac76f19b939fc9015bf3bcbc21a34c925af7: exit status 128: fatal: could not read Username for 'https://github.com': terminal prompts disabled Confirm the import path was entered correctly. If this is a private repository, see https://golang.org/doc/faq#git_https for additional information. If you have already googled this issue, you may find that most of the answers tell you to configure your git as shown below: ...

[Wget] Unable to locally verify the issuer's authority

1. Error This issue happens when I run the command wget https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 in my Ubuntu WSL. The completed error looks like below: The extracted error is >> connected. >> ERROR: cannot verify objects.githubusercontent.com's certificate, issued by ‘CN=ospanel’: >> Unable to locally verify the issuer's authority. >> ERROR: certificate common name ‘localhost’ doesn't match requested host name ‘objects.githubusercontent.com’. >> To connect to objects.githubusercontent.com insecurely, use `--no-check-certificate'. You can see there are basically four highlight errors above and many answers for each error if you google them. I had tried the below workarounds in WSL: ...

[VSCode] module lookup disabled by GOPROXY

Sometimes when I open the Golang project with VSCode, some import packages are highlighted with error underline and the error message is like below error while importing github.com/jpillora/chisel/client: module lookup disabled by GOPROXY=off If you are sure that the packages are downloaded already, reloading the VSCode window should solve the issue.

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !