# APIError 408 When Uploading New Module

**URL:** <https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691>\
**Category:** Technical Support & Bugs\
**Created:** [December 19, 2025, 7:20pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691 "2025-12-19T19:20:15Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Daniel\_T\_Shaw](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/daniel_t_shaw/32/11358_2.png) [@Daniel\_T\_Shaw](https://forum.vassalengine.org/u/Daniel_T_Shaw)\
**Post date:** [January 18, 2026, 9:19pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/21 "2026-01-18T21:19:33Z")

</div>

For information, the progress bar makes it about one third of the way across before it trips

 ![image](https://forum.vassalengine.org/uploads/default/original/2X/2/27ad062b9b63bdbaa66766763fab245529fb9fa8.png)

And displays

 ![image](https://forum.vassalengine.org/uploads/default/original/2X/f/f5f2faacbed1aa2758f5571777bdf27de04260d5.png)

Daniel

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 21, 2026, 2:02am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/22 "2026-01-21T02:02:22Z")

</div>

I’ve added some additional diagnostic logging. Please try uploading a file that was failing before and let me know the filename and when you tried.

---

<div class="post-metadata">

**Author:** ![Daniel\_T\_Shaw](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/daniel_t_shaw/32/11358_2.png) [@Daniel\_T\_Shaw](https://forum.vassalengine.org/u/Daniel_T_Shaw)\
**Post date:** [January 21, 2026, 5:56pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/23 "2026-01-21T17:56:29Z")

</div>

Is it fortunate or unfortunate that the file loaded properly this morning!?!

Maybe you can spot what improved.

Page is  
/library/projects/Europa\_Full\_Current\_Map

File uploaded is  
/gls/3/d/EuropaCurrentMapV310.vmod

Daniel

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 21, 2026, 10:15pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/24 "2026-01-21T22:15:53Z")

</div>

> [@Daniel\_T\_Shaw](#):
>
> Is it fortunate or unfortunate that the file loaded properly this morning!?!

That’s unlucky. I changed no code beyond adding some additional logging.

I need somebody who can reproduce the problem to do so and let me know they have.

---

<div class="post-metadata">

**Author:** ![Alexander331bc](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@Alexander331bc](https://forum.vassalengine.org/u/Alexander331bc)\
**Post date:** [January 22, 2026, 12:25am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/25 "2026-01-22T00:25:52Z")

</div>

I got some free time late this afternoon, but the file failed to upload. I’m getting the same error.

-Joel

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 22, 2026, 1:17am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/26 "2026-01-22T01:17:52Z")

</div>

This is what I see in the logs from earlier today:

```auto
2026-01-22T00:09:24.438747Z INFO request{source=158.62.192.93 method=POST uri=h
ttp://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/M
odule/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: starting add_file
2026-01-22T00:09:24.440159Z INFO request{source=158.62.192.93 method=POST uri=h
ttp://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/M
odule/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: created temp file uploads
/atmp_13510757fb3e5bd6d2069716ab41a2a4b27
2026-01-22T00:09:24.440187Z INFO request{source=158.62.192.93 method=POST uri=h
ttp://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/M
odule/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: 87
2026-01-22T00:09:24.440195Z INFO request{source=158.62.192.93 method=POST uri=h
ttp://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/M
odule/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: 96
2026-01-22T00:09:24.440197Z INFO request{source=158.62.192.93 method=POST uri=h
ttp://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/M
odule/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: 101
2026-01-22T00:14:24.469962Z INFO request{source=158.62.192.93 method=POST uri=http://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/Module/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: finished processing request latency=300033 ms status=408

```

The third, fourth, and fifth entries give line numbers.

The relevant code is:

```rust
pub async fn stream_to_writer<S, W>(
    stream: S,
    writer: W
) -> Result<(String, u64), io::Error>
where
    S: Stream<Item = Result<Bytes, io::Error>> + Send,
    W: AsyncWrite
{
    info!("{}", line!());

    // make hashing reader
    let mut hasher = Sha256::new();
    let reader = InspectReader::new(
        StreamReader::new(stream),
        |buf| hasher.update(buf)
    );

    info!("{}", line!());

    // read stream
    futures::pin_mut!(reader);
    futures::pin_mut!(writer);
    info!("{}", line!());
    let size = tokio::io::copy(&mut reader, &mut writer).await?;
    let sha256 = format!("{:x}", hasher.finalize());

    info!("{}", line!());
    Ok((sha256, size))
}

```

What we’re not seeing in the logs is the last `info!`. The time from the first log message to the second to last is 1.4ms, but almost 6 minutes elapsed between that and the last.

I’ve added more another `info!` between writing the file and finalizing the hash. Please try again and let me know when you do.

This is likely to require quite a few more tries to solve. Thank you for continuing to help troubleshoot.

---

<div class="post-metadata">

**Author:** ![Alexander331bc](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@Alexander331bc](https://forum.vassalengine.org/u/Alexander331bc)\
**Post date:** [January 22, 2026, 3:53pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/27 "2026-01-22T15:53:50Z")

</div>

Ok, I tried again this morning. It made it about 2/3 before failing.

-Joel

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 22, 2026, 5:17pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/28 "2026-01-22T17:17:14Z")

</div>

> [@uckelman](#):
>
> `let size = tokio::io::copy(&mut reader, &mut writer).await?;`

That confirmed for me that your upload doesn’t make it past

```rust
let size = tokio::io::copy(&mut reader, &mut writer).await?;

```

The is the line that reads all the data from the stream (via a hasher) and writes it to disk. I’m going to consult with the tokio discord to see if they can give me any ideas about why that could take so long, but only for some uploads.

---

<div class="post-metadata">

**Author:** ![Daniel\_T\_Shaw](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/daniel_t_shaw/32/11358_2.png) [@Daniel\_T\_Shaw](https://forum.vassalengine.org/u/Daniel_T_Shaw)\
**Post date:** [January 23, 2026, 4:33am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/29 "2026-01-23T04:33:00Z")

</div>

> [@uckelman](#):
>
> ```auto
> 
> // read stream
> futures::pin_mut!(reader);
> futures::pin_mut!(writer);
> info!("{}", line!());
> let size = tokio::io::copy(&mut reader, &mut writer).await?;
>     
> 
> ```

I’m not a programmer, so I don’t pretend to read the code, but have been a (rather innocent and naive) project director with a team of programmers who did, so I ask the silly questions that sometimes help…

When it says “await”, might it need more time to write than it took to read?

Maybe not helpful. I thought I’d ask.

Daniel

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 23, 2026, 4:36am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/30 "2026-01-23T04:36:14Z")

</div>

> [@Daniel\_T\_Shaw](#):
>
> When it says “await”, might it need more time to write than it took to read?

The `await` keyword in Rust means that you’re calling an asynchronous function, and you want execution to resume here when it finishes. It’s how you resolve the futures that asynchronous functions return.

Good guess, but it’s not that.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 25, 2026, 5:47pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/31 "2026-01-25T17:47:38Z")

</div>

I’ve added yet more logging, so we can see exactly how far the upload gets. Please try again.

---

<div class="post-metadata">

**Author:** ![MarkHodgkinson](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/markhodgkinson/32/12521_2.png) [@MarkHodgkinson](https://forum.vassalengine.org/u/MarkHodgkinson)\
**Post date:** [January 26, 2026, 11:58am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/32 "2026-01-26T11:58:07Z")

</div>

I still got it

 ![image](https://forum.vassalengine.org/uploads/default/original/2X/3/393ab239cbedbd56df42ce5a15db4fe125a1a7f2.png)

---

<div class="post-metadata">

**Author:** ![Alexander331bc](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@Alexander331bc](https://forum.vassalengine.org/u/Alexander331bc)\
**Post date:** [January 27, 2026, 12:56am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/33 "2026-01-27T00:56:56Z")

</div>

Sorry for the delay here. Busy weekend. I tried and got the same 408 error.

---

<div class="post-metadata">

**Author:** ![Alexander331bc](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@Alexander331bc](https://forum.vassalengine.org/u/Alexander331bc)\
**Post date:** [January 27, 2026, 12:57am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/34 "2026-01-27T00:57:29Z")

</div>

Hey Mark, try logging out and logging back in. That seems to fix the 401 error.

-Joel T

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 27, 2026, 3:35am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/35 "2026-01-27T03:35:29Z")

</div>

> [@Alexander331bc](#):
>
> I tried and got the same 408 error.

You’re going to keep getting the error while I’m adding diagnostic logging. That’s expected.

---

<div class="post-metadata">

**Author:** ![MarkHodgkinson](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/markhodgkinson/32/12521_2.png) [@MarkHodgkinson](https://forum.vassalengine.org/u/MarkHodgkinson)\
**Post date:** [January 29, 2026, 10:41pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/36 "2026-01-29T22:41:43Z")

</div>

I tried again 401 error. logged out and in several times.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 30, 2026, 1:31am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/37 "2026-01-30T01:31:45Z")

</div>

> [@Alexander331bc](#):
>
> Sorry for the delay here. Busy weekend. I tried and got the same 408 error.

On this attempt, I saw:

```auto
2026-01-26T04:24:37.057946Z INFO request{source=158.62.195.181 method=POST uri=http://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/Module/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: starting add_file
...
2026-01-26T04:24:37.059744Z INFO request{source=158.62.195.181 method=POST uri=http://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/Module/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: 87
2026-01-26T04:24:37.059752Z INFO request{source=158.62.195.181 method=POST uri=http://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/Module/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: 102
...
2026-01-26T04:29:36.847820Z INFO request{source=158.62.195.181 method=POST uri=http://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/Module/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: 102564826
2026-01-26T04:29:36.847825Z INFO request{source=158.62.195.181 method=POST uri=http://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/Module/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: 102564915
2026-01-26T04:29:37.061842Z INFO request{source=158.62.195.181 method=POST uri=http://vassalengine.org/v1/projects/Assault_Sicily_43_-_Gela_Beachhead/packages/Module/1.2.1/AssaultSicily1.2.1.vmod version=HTTP/2.0}: finished processing request latency=300026 ms status=408

```

The log entries with just a number are indicating how many bytes of the file have been read. The file is 272173883 bytes in total; processing only got through 102564915 bytes before timing out. That’s a bit over a third of the entire file. (There’s one log entry for each read from the stream, thousands in total; I’ve excerpted here the first two and last two to establish a frame of reference.)

The reads are far, far smaller than I was expecting. The first read advanced to offset 87, and the second one only to 107. There are a _lot_ of tiny reads. There are also some which are 8192 bytes, which probably corresponds to having filled an 8KB buffer. Doing a huge number small reads is not what I was expecting to see; that’s going to be slower than a smaller number of large reads. I think the huge number of small reads is why the upload is timing out for you; I don’t know why this is happening for some people and not others.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 30, 2026, 2:01am UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/38 "2026-01-30T02:01:03Z")

</div>

I’ve made a small change that I’d like to see the effect of. Previously, the hasher wrapped the stream reader, which means that every read from the stream went directly to the hasher. When the reads are small, this means many calls to the hasher for small amounts of data. I’ve moved the hasher to wrap the writer instead. The writer is called only on full buffers, so this should result in fewer calls to the hasher on larger amounts of data.

Please try uploading the file again.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [February 2, 2026, 12:11pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/39 "2026-02-02T12:11:21Z")

</div>

I can’t tell if I’ve fixed the problem unless someone having it tries uploading a file again and lets me know that’s happened.

---

<div class="post-metadata">

**Author:** ![Alexander331bc](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ac91a4/32.png) [@Alexander331bc](https://forum.vassalengine.org/u/Alexander331bc)\
**Post date:** [February 3, 2026, 6:05pm UTC](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691/40 "2026-02-03T18:05:21Z")

</div>

I tried last night and again this morning. Same error.

-Joel T.

[Previous page](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691.md?page=1)

[Next page](https://forum.vassalengine.org/t/apierror-408-when-uploading-new-module/89691.md?page=3)
