Whats with this error? [NOBLOX.JS-SERVER]

Hello again, I’m still working on my Noblox.js server. I have this odd error, but I have no clue how to resolve this.

image

Here’s the configuration that I’m using. Note that I’m using a Raspberry Pi, meaning I have a custom domain, and the :8080 port at the end. When I head to the url, it shows what it should show, but for some reason it errors.

If I change the url to something non-existant, it shows a ConnectFail error instead, meaning it does indeed connect, but doesn’t do anything.

The Raspberry Pi has been port-forwarded with the correct port
image

So I have no clue why it’s not doing anything.
Could anybody help?

I’ve tried everything, from changing the port, to updating the cookie.

1 Like

Also, the bot does have permissions to accept and decline requests.

image

I’m not entirely sure if this goes here, seeing as Noblox.js is… well… not lua, and not really supported by Roblox.

However, I have experience working with it.

Your port forwarding configuration should be set so your domain doesn’t include a port. The whole idea of DNS’s and domains is to exclude numbers, because humans remember names better than numbers.

In theory if you’ve port forwarded port 8080 AND noblox.js server is infact listening to requests on port 8080, then simply ending your domain without :8080 will be fine, as your router or whatever is port forwarding will figure it out for you.

That being said, I do not recommend hosting this on a personal raspberry pi. Heroku is free and designed for use cases like this.

Check it out from the creator of noblox.js.

1 Like

I get this error when removing the port, like I said:

image

And I can’t add the port numbers to freenom, as it says
image
When I add it to the ip. Besides, it’s not the domains fault anyway.

Edit:
The only reason I’m doing this is because I want a reason to use my Raspberry Pi that I paid 60+ USD for (not including case), and it’s in scripting support because I need help with some code, and that code is in studio. The server works fine but the code doesn’t.

Can I get screenshots of each line that is erroring? It says there is a connect fail and theres lines 22, 47, 76, 124 and 6.

Want to put all those code lines there?

Its just the modulescript thats on noblox.js’s github.

local groups = {}
local module = {}
local setmetatable = setmetatable
local error = error
local wait = wait
local httpService = game:GetService'HttpService'
local postAsync = httpService.PostAsync
local getAsync = httpService.GetAsync
local jsonEncode = httpService.JSONEncode
local jsonDecode = httpService.JSONDecode
local base, key

local function encode (tab)
  return jsonEncode(httpService, tab)
end

local function decode (tab)
  return jsonDecode(httpService, tab)
end

local function request (url, method, suppress, data)
  local body = method(httpService, url, data)
  local success, response = pcall(decode, body)
  local err
  if success then
    err = response.error
  else
    err = 'Response was not valid json, full body: '..body
  end
  if not err and suppress then
    return true, response
  elseif not err then
    return response
  elseif suppress then
    return false, err
  else
    error(err)
  end
end

local http = {
  post = function (path, data, suppress)
    if not data then
      data = {}
    end
    data.key = key
    return request(base..path, postAsync, suppress, encode(data))
  end,
  get = function (path, suppress)
    return request(base..path, getAsync, suppress)
  end
}

function groups.promote (group, userId)
  return http.post('/promote/'..group..'/'..userId)
end

function groups.demote (group, userId)
  return http.post('/demote/'..group..'/'..userId)
end

function groups.setRank (group, userId, rank)
  return http.post('/setRank/'..group..'/'..userId..'/'..rank)
end

function groups.shout (group, message)
  return http.post('/shout/'..group, {message = message})
end

function groups.post (group, message)
  return http.post('/post/'..group, {message = message})
end

function groups.handleJoinRequest (group, username, accept)
  local acceptString = accept and 'true' or 'false'
  return http.post('/handleJoinRequest/'..group..'/'..username..'/'..acceptString)
end

function groups.getPlayers (group, rank, limit, online)
  local job = http.post('/getPlayers/make/'..group..(rank and '/'..rank or '')..'?limit='..(limit and limit or '-2')..'&online='..(online and 'true' or 'false')).data.uid
  local complete, response = false
  repeat
    wait(0.5)
    local success
    success, response = http.get('/getPlayers/retrieve/'..job, true)
    if not success and response:match('$Response was not valid json') then
      error(response)
    elseif success then
      complete = response.data.complete
    end
  until complete
  return response
end

function module.message (userId, subject, message)
  return http.post('/message/'..userId, {subject = subject, body = message})
end

function module.getBlurb (userId)
  return http.get('/getBlurb/'..userId)
end

return function (domain, newKey, group)
  local isString = (type(domain) == 'string')
  if (not domain) or (not isString) or (isString and #domain <= 0) then
    error('Url is required and must be a string greater than length 0')
  end
  isString = (type(newKey) == 'string')
  if (not newKey) or (not isString) or (isString and #newKey <= 0) then
    error('Key is required and must be a string greater than length 0')
  end

  base = 'http://'..domain
  key = newKey

  if group then
    local isNumber = (type(group) == 'number')
    if (not isNumber) or (group <= 0) then
      error('If group is provided it must be a number greater than 0')
    end

    for name, func in next, groups do
      module[name] = function (...)
        return func(group, ...)
      end
    end
    return module
  end

  for name, func in next, groups do
    module[name] = func
  end
  return module
end

What does your noblox server output say?

It has no errors, just says something like Listening on port 8080.

Is it only the handleJoinRequest that isn’t working, or do they all give you an error?

I’m not sure, I’ll have to tell you in the morning.

Edit: Only handleJoinRequest

Active checkbox is turned off. did you turn it on?

The checkbox is to select which ports to delete, if I wanted to delete it., it says “Active” because the port forwarding is active.

Also, the domain has been entered, but please tell me what happens if you enter the [EDIT: Global] IP address.

OK, I put in the ip, and the same thing happens, but I tried getBlurb to see if anything else would happen, and it showed what it should show, which is ROBLOX’s profile’s description, so maybe I just need to rewrite the handleJoinRequest code and place it into a function?

As a confirmation, did you enter the global IP address? Or did you enter your local IP address?

The global IP address, which starts like 192.168 , not 127.0.0.1 , which is usually the local ip, I believe.

Well, that’s wrong…
Local IP is 192.168.xxx.xxx
Global IP is not start as 192.168

127.0.0.1 is for loopback ip.

But it works?

I thought that the ips are different depending on which router brand you own.

When I joined my friends locally hosted minecraft server, it didn’t start like that.
It start like 72.???

Yes, the global IP address depends on the company that owns it, but the local IP address does not.

Absolutely not.
I recommend to start by learning local and global IP addresses.