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

Niether MasscanWrapper or the discoveryAPI works. #2

Closed
TheFlyingDog42 opened this issue Nov 11, 2022 · 15 comments
Closed

Niether MasscanWrapper or the discoveryAPI works. #2

TheFlyingDog42 opened this issue Nov 11, 2022 · 15 comments
Labels
enhancement New feature or request good first issue Good for newcomers invalid This doesn't seem right question Further information is requested

Comments

@TheFlyingDog42
Copy link

The different programs need different versions of .NET, so I don't even see how you would be able to run both of them at the same time in a simple way. So I started with only trying to get the MasscanWrapper to work.

It doesn't work 😢. Please help, I don't understand what's wrong.
image

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 11, 2022

The different programs need different versions of .NET, so I don't even see how you would be able to run both of them at the same time in a simple way

Although it should be quite easy to have both versions installed, I do agree that it is quite stupid that two different versions of .NET are used. I'll fix this asap, hopefully this weekend if I can find the time. Feel free to open a PR to fix it yourself

So I started with only trying to get the MasscanWrapper to work.
It doesn't work 😢. Please help, I don't understand what's wrong.

The scanner should prompt ask for a location to the Masscan.exe compiled binary. Do you have a functional Masscan.exe file and are you pointing to this file correctly when asked by the scanner?

@SieBRUM SieBRUM added enhancement New feature or request good first issue Good for newcomers question Further information is requested labels Nov 11, 2022
@TheFlyingDog42
Copy link
Author

TheFlyingDog42 commented Nov 11, 2022

I'm unsure. I couldn't get the compiler to work for the Masscan zip, so I used https://github.com/Arryboom/MasscanForWindows instead. This could be the problem, but I don't have the knowlage to compile it myself 😞. (Im on windows 11 so doing this stuff is kinda hard, I managed to get the Masscan to work on my ubuntu laptop however, but I just get a shared library file instead, not a .exe)

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 11, 2022

That should actually just work. You can try to run the file yourself to check if it executes.
The scanner points to Desktop by default, is this where the Masscan is located to? You could try to change the location of the file.

@TheFlyingDog42
Copy link
Author

I got it to work! For some reason it just worked this time, it was probably because I renamed the masscan.exe.

(I'll leave the issue open, If that's okay. I will probably come across more problems in the future, but thanks for the support.)

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 11, 2022

Nice (: Ill close the issue once I fixed the .NET versions. Feel free to open a new issue if you need any help on another topic.

@TheFlyingDog42
Copy link
Author

Well, my problem is with the .NET versions, so maybe it belongs here.
image
This happens when I build the API file, and when I try to run it;

image
This happens, and the terminal just closes after about 2 seconds. I guessing it's because I have the wrong .NET version, but I've tried both the latest 5.0 version, and 5.0.0 and none of them do any difference. (Image is from the 5.0.0 try)

It could also be a problem with the database, since I havn't set one up. (If that is a requirement)

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 11, 2022

Having a database is a requirement and you have to set the database string manually. It tries to pull it from your env variables by default and expects a MySQL database. All of this is configurable here: https://github.com/SieBRUM/minecraft-server-discovery/blob/main/backend/MinecraftServerDiscoveryApi/Contexts/DatabaseContext.cs#L20

I myself run a local docker container with MySQL in it, but you can use whatever setup you like obviously

@SieBRUM SieBRUM added the invalid This doesn't seem right label Nov 12, 2022
@TheFlyingDog42
Copy link
Author

Regardless of what I put in there I get
System.MissingFieldException: Database environment variable not found.

I set up a mySQL database, and changed the Env to match my credentials. What is wrong?
("server=127.0.0.1;user=root;password=MyPassWord;database=MYSQL")

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 12, 2022

You either did not set the environment variable correctly, or you did not restart your terminal / visual studio / whatever you are using after setting it.

It should look like this:
image

@TheFlyingDog42
Copy link
Author

This is probably my last question:
image
It seems like it should work now because the first time I started the API with the right credentials for the mySQL database it created all of the tables (bottom right) automatically. But no data is written in the tables.

Is there something wrong with the database? I didn't change any settings if that is necessary.

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 12, 2022

Your scanner is not running in this picture. The scanner fills the database with information. You will see text in the window of the scanner saying it has found a server. At that point it should sent a message to the API. The API will probably log to console that it received a message. It will then write it to the DB.

@TheFlyingDog42
Copy link
Author

Oops. (I ran it before and nothing happened, but I'm trying again, and actually showing what is happening.)
image
image

  1. The API stays the same way throughout the entire run
  2. The DB doesn't get any information (It doesn't write to disk at all)
  3. Also nothing happens on the website (obviusly)
    image

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 12, 2022

Looks like the API is not receiving any requests. You should do some debugging yourself to try and fix this.

@TheFlyingDog42
Copy link
Author

How does the API get the data from the wrapper? I'm not good enough to make this work 😠

@SieBRUM
Copy link
Owner

SieBRUM commented Nov 12, 2022

Ok so I made some changes so it SHOULD be more easy to run everything (see PR #3)

How to run with Docker:

  • Clone the repository (or pull the new version)
  • Open terminal in root of the repository
  • Execute docker compose up (or docker-compose up if you are old-fashioned) (the backend should crash a couple of times, this is because it takes like ~20 seconds to setup the DB container. Just give it some time, it restarts automatically) (you can remove everything with docker-compose down -v and remove the images)
  • Everything should be running (frontend: localhost:80, backend: localhost:5000)
  • You can now start the Wrapper on your machine (same machine as you just ran these commands on)

I tried to make it as easy as possible for ya (:

I also changes the .NET versions so they are the same

@SieBRUM SieBRUM closed this as completed Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants