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

No ingame upload possible with error message #156

Open
MarkMcWire opened this issue Apr 23, 2024 · 10 comments
Open

No ingame upload possible with error message #156

MarkMcWire opened this issue Apr 23, 2024 · 10 comments
Assignees
Labels
bug Something isn't working engine Needs C++ coding changes

Comments

@MarkMcWire
Copy link
Contributor

MarkMcWire commented Apr 23, 2024

Since two weeks I cannot upload my Europeans tribe addon. There is always an error. See screenshot.

Bildschirmfoto vom 2024-04-19 17-48-08

If I want to update the food addon, the upload works, but a similar error message appears afterwards.

Upload of my map addon or the debug script addon works fine.

@MarkMcWire MarkMcWire changed the title No Upload Ingame possible with error message No ingame upload possible with error message Apr 23, 2024
@bunnybot
Copy link
Contributor

Mirrored on Codeberg as #CB87.

@bunnybot bunnybot added the bug Something isn't working label Apr 23, 2024
@bunnybot bunnybot self-assigned this Apr 23, 2024
@bunnybot
Copy link
Contributor

Assigned to Nordfriese

@bunnybot bunnybot added the engine Needs C++ coding changes label Apr 23, 2024
@MarkMcWire
Copy link
Contributor Author

MarkMcWire commented Apr 23, 2024

Nope:

[00:00:25.656 real] ERROR: upload addon europeans_tribe.wad: Expected a int, received:

@bunnybot
Copy link
Contributor

NordfrieseMirrored from Codeberg
On Wed Apr 24 10:15:37 CEST 2024, Benedikt Straub (Nordfriese) wrote:


Did you check out and compile the branch https://github.com/widelands/widelands/tree/mirror/Nordfriese/widelands/87-addon-upload-error ? (The bug is in Widelands, not in the server)

@MarkMcWire
Copy link
Contributor Author

MarkMcWire commented Apr 27, 2024

I am unable to compile this branch. Tried in a virtual machine with Ubuntu and with LinuxMint. All dependencies are installed.
I will try it with Fedora and OpenSuse in the next days.

The SegFault error occurs in every OS on another position.

@MarkMcWire
Copy link
Contributor Author

MarkMcWire commented May 29, 2024

It must be a server problem. I just tried to overwrite the addon "europeans_tribe.wad" on the server with an empty addon (only containing the addon file) and I got the same error message. So it can't be because the amount of data is too large or the transfer is leaking or something like that.

The server is sending some signal or data that the game cannot process correctly.

Have you ever checked the hash algorithm that compares local and server data?

@bunnybot
Copy link
Contributor

NordfrieseMirrored from Codeberg
On Thu May 30 11:44:28 CEST 2024, Benedikt Straub (Nordfriese) wrote:


The server log simply says this:

[Wed May 29 19:45:16 CEST 2024 @ Client<#>2961] Received command: 2:CMD_SUBMIT europeans_tribe.wad
[Wed May 29 19:45:28 CEST 2024 @ Client<#>2961] ERROR: WL Protocol Exception: Stream ended unexpectedly while reading file
WL Protocol Exception: Stream ended unexpectedly while reading file
        at wl.server.HandleCommand.doHandleCmdSubmit_New(HandleCommand.java:1271)
        at wl.server.HandleCommand.lambda$handleCmdSubmit$7(HandleCommand.java:920)
        at wl.server.ServerUtils.doSemaphore(ServerUtils.java:116)
        at wl.server.ServerUtils.semaphoreRW(ServerUtils.java:109)
        at wl.server.HandleCommand.handleCmdSubmit(HandleCommand.java:898)
        at wl.server.HandleCommand.handle(HandleCommand.java:152)
        at wl.server.ClientThread.run(ClientThread.java:128)
        at java.base/java.lang.Thread.run(Thread.java:833)
[Wed May 29 19:45:28 CEST 2024 @ Client<#>2961] Connection quit.

The hashing algorithm is fine (tested a lot when first implementing it), so it must be a problem locally in the Widelands client. It might be related to the new timeouts, maybe try editing src/net_addons.cc and comment out the setsockopt calls in lines 202 204 210 212 and try if this changes anything. If not, please again post the complete log output of Widelands (run with --verbose!).

diff --git a/src/network/net_addons.cc b/src/network/net_addons.cc
index f62bcc7868..3b575384dc 100644
--- a/src/network/net_addons.cc
+++ b/src/network/net_addons.cc
@@ -199,17 +199,17 @@ void NetAddons::init(std::string username, std::string password) {
 	DWORD timeout_val = kTimeout * 1000;
 	const char* timeout_ptr = reinterpret_cast<const char*>(&timeout_val);
 	// Set timeout of read()
-	setsockopt(client_socket_, SOL_SOCKET, SO_RCVTIMEO, timeout_ptr, sizeof(timeout_val));
+	// setsockopt(client_socket_, SOL_SOCKET, SO_RCVTIMEO, timeout_ptr, sizeof(timeout_val));
 	// Set timeout of write()
-	setsockopt(client_socket_, SOL_SOCKET, SO_SNDTIMEO, timeout_ptr, sizeof(timeout_val));
+	// setsockopt(client_socket_, SOL_SOCKET, SO_SNDTIMEO, timeout_ptr, sizeof(timeout_val));
 #else
 	struct timeval timeout_val;
 	timeout_val.tv_sec = kTimeout;
 	timeout_val.tv_usec = 0;
 	// Set timeout of read()
-	setsockopt(client_socket_, SOL_SOCKET, SO_RCVTIMEO, &timeout_val, sizeof(timeout_val));
+	// setsockopt(client_socket_, SOL_SOCKET, SO_RCVTIMEO, &timeout_val, sizeof(timeout_val));
 	// Set timeout of write()
-	setsockopt(client_socket_, SOL_SOCKET, SO_SNDTIMEO, &timeout_val, sizeof(timeout_val));
+	// setsockopt(client_socket_, SOL_SOCKET, SO_SNDTIMEO, &timeout_val, sizeof(timeout_val));
 #endif
 
 	const std::string target_ip = get_config_string("addon_server_ip", "widelands.org");

@MarkMcWire
Copy link
Contributor Author

MarkMcWire commented Jun 1, 2024

That fixed the problem.

@bunnybot
Copy link
Contributor

bunnybot commented Jun 1, 2024

NordfrieseMirrored from Codeberg
On Sat Jun 01 10:17:02 CEST 2024, Benedikt Straub (Nordfriese) wrote:


Ok, I have added a commit to the linked Widelands branch that suppresses the timeouts just for selected operations including uploading an add-on. The next time you update the europeans add-ons suite can you please try again with the latest commit to verify that the fix still works in that form? (We can't simply apply the above patch to master, the timeouts were added to fix a different bug…)

@MarkMcWire
Copy link
Contributor Author

Setting constexpr uint32_t kTimeout = 16; solved the problem, even without comment out these lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working engine Needs C++ coding changes
Projects
None yet
Development

No branches or pull requests

2 participants