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

Network.Socket.listen Error: Permission denied (WSAEACCESS) #3891

Open
NickEmpetvee opened this issue Jan 31, 2025 · 20 comments
Open

Network.Socket.listen Error: Permission denied (WSAEACCESS) #3891

NickEmpetvee opened this issue Jan 31, 2025 · 20 comments
Labels
question windows Related to the Windows Operating System

Comments

@NickEmpetvee
Copy link

OS: WIN 11

Hi guys,

When I start Postgrest with the most recent executable, I am getting the below error.

C:\dev\Postgrest>postgrest.exe postgrest.conf
postgrest.exe: Network.Socket.listen: failed (Permission denied (WSAEACCESS))

It fails to launch. Any suggestions? Thanks!

Nick

@develop7
Copy link
Collaborator

Could you paste postgrest.conf here as well?

@NickEmpetvee
Copy link
Author

@develop7 please see below DEV configuration


db-uri = "postgres://postgres:*******@localhost/some_db"
db-schema = "api"
db-anon-role = "web_anon"
log-level = "info"
jwt-secret = "******"
jwt-cache-max-lifetime = 60
db-pre-request = "basic_auth.validation"
server-port = 14325
server-host = "*"

@steve-chavez steve-chavez changed the title Network.Socket.listen Error Network.Socket.listen Error: Permission denied (WSAEACCESS) Jan 31, 2025
@steve-chavez steve-chavez added the windows Related to the Windows Operating System label Jan 31, 2025
@wolfgangwalther
Copy link
Member

This could be because of the specific port you are using. Try setting a different port, for example keep it at the default 3000. Does that make a difference?

Also see https://stackoverflow.com/questions/48478869/cannot-bind-to-some-ports-due-to-permission-denied

@NickEmpetvee
Copy link
Author

NickEmpetvee commented Jan 31, 2025

This could be because of the specific port you are using. Try setting a different port, for example keep it at the default 3000. Does that make a difference?

Also see https://stackoverflow.com/questions/48478869/cannot-bind-to-some-ports-due-to-permission-denied

@wolfgangwalther Thanks, The default 3000 gives the same result. I've tried several port numbers at this point. It used to work at 14325 until a few days ago when I updated to v12.2.5. The same happens with 12.2.6. This doesn't happen with the old version: 12.0.2.

@wolfgangwalther
Copy link
Member

It used to work at 14325 until a few days ago when I updated to v12.2.5. The same happens with 12.2.6. This doesn't happen with the old version: 12.0.2.

Aha!

Can you try to work out which version exactly broke?

@NickEmpetvee
Copy link
Author

NickEmpetvee commented Feb 3, 2025

Aha!

Can you try to work out which version exactly broke?

The oldest version with the problem is v12.2.2. When I virus-scan it with Avira, it is analyzed with a "HEUR/APC" threat. None of the versions prior to that trigger this.

I added an exception for the virus-scan to ignore file and folder, yet the affected versions won't run and return that WSAEACCESS message, so there may be some other protection measure that's blocking it. Please note that versions v12.2.1 and earlier run fine and don't trigger any virus scan message.

@wolfgangwalther
Copy link
Member

That's great help already.

The oldest version with the problem is v12.2.2. [...] Please note that versions v12.2.1 and earlier run fine [...]

Since we don't run windows and can't reproduce it, you could try to narrow it down even further:

This is the list of commits, between those two versions:
v12.2.1...v12.2.2

Most commits have a green checkmark on them. You can click that, then go to any "Details" and then on to "Summary" on the top left. Then scroll down and you should see the artifacts from the CI run for that commit, including a windows binary.

If you could pin-point it to the commit that made it break, that would be great.

@wolfgangwalther
Copy link
Member

We just released v12.2.7 which contains a single fix for Windows. This is probably entirely unrelated, but it might still be worth a try - after all, we have no idea what Avira jumps on here.

@NickEmpetvee
Copy link
Author

NickEmpetvee commented Feb 4, 2025

v12.2.7 also has issues. I'm still looking into the list of commits and will share once done.

Avira has a way of submitting the binary on that form. The file can be specified as a false positive. They'll want a contact point, and maybe the email of someone from this project would be best in case they have questions. Can someone upload the file there w/contact information?

@NickEmpetvee
Copy link
Author

Hmm, the artifacts for the commits seem to be expired in all cases from that list of commits? I can't download them.

@NickEmpetvee
Copy link
Author

@wolfgangwalther is there any otherr way to download the WIN binaries in that list of commits? We'll have to spend a lot of time re-engineering without a solution to this so I'm happy to help test and pinpoint, to the limitation of my knowledge.

@develop7
Copy link
Collaborator

develop7 commented Feb 6, 2025

@wolfgangwalther can you restart builds for these commits? @NickEmpetvee in the meantime I think you could rebuild those as well, just in your fork. Let me try too

@wolfgangwalther
Copy link
Member

an you restart builds for these commits?

I looked into that earlier today, too, but it doesn't seem like that's possible after they have expired. I can only re-run failed CI jobs :/

@develop7
Copy link
Collaborator

develop7 commented Feb 6, 2025

@wolfgangwalther have you tried API as well — https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run (for 521acf6 JOB_ID would be 26935726678; via https://github.com/PostgREST/postgrest/actions/runs/9759319011/job/26935726678)

@NickEmpetvee
Copy link
Author

@develop7 @wolfgangwalther I also communicated to Avira that I believe this was a false positive. The response message on their form said they would evaluate it. However, the message didn't provide a timeline or confirm that they would get back to me with results.

@wolfgangwalther
Copy link
Member

@wolfgangwalther have you tried API as well — https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#re-run-a-job-from-a-workflow-run (for 521acf6 JOB_ID would be 26935726678; via https://github.com/PostgREST/postgrest/actions/runs/9759319011/job/26935726678)

Just tried and this is the result:

{
  "message": "Unable to re-run this job because the workflow run was created over a month ago",
  "documentation_url": "https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run",
  "status": "403"
}

@wolfgangwalther
Copy link
Member

wolfgangwalther commented Feb 7, 2025

I created some PRs in my fork for the most relevant commits between 12.2.1 and 12.2.2. I have two runs scheduled:

Everything else... was so trivial, it shouldn't make a difference.

Once they are done, you should be able to use the artifacts from the respective download page.

Edit: One more case is a rebuild of v12.2.1 directly, which was still proven to work, can be found here: https://github.com/wolfgangwalther/postgrest/actions/runs/13208217562/job/36876308678 - if this breaks, then the problem was in the underlying GHA windows runner image.

@NickEmpetvee
Copy link
Author

Edit: One more case is a rebuild of v12.2.1 directly, which was still proven to work, can be found here: https://github.com/wolfgangwalther/postgrest/actions/runs/13208217562/job/36876308678 - if this breaks, then the problem was in the underlying GHA windows runner image.

@wolfgangwalther the rebuild of v12.2.1 got quarantined by the antivirus.

@wolfgangwalther
Copy link
Member

the rebuild of v12.2.1 got quarantined by the antivirus.

Uh... let the fun begin...

That one will be hard to debug :D

@wolfgangwalther
Copy link
Member

wolfgangwalther commented Feb 9, 2025

So, my findings:

The second release has an update for Cabal:

Cabal 3.10.3.0 3.12.1.0

But.. we are building with Stack. So not sure how that would be related. (Edit: Ah, stack uses cabal as a library - so this could indeed be related)

All the other changes in those images look entirely unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question windows Related to the Windows Operating System
Development

No branches or pull requests

4 participants