blake-mealey / mantle

An infrastructure-as-code and deployment tool for Roblox.
https://mantledeploy.vercel.app/
MIT License
91 stars 11 forks source link

Updating a place resource will always 404 #143

Closed autonordev closed 2 years ago

autonordev commented 2 years ago

I'm running 0.11.1 but it seems like this is affecting all versions of Mantle.

Deploying resources:
  ╷
  │  ~ Updating: placeFile_start
  │    ╷
  │    │  Dependencies:
  │    │      - place:
  │    │          assetId: XXXXXXXXX
  │    │  Inputs:
  │    │      placeFile:
  │    │        filePath: game.rbxlx
  │    │    -   fileHash: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  │    │    +   fileHash: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  │    │  
  │    ╰─ Failed: Unknown error (status 404 Not Found)
  │
  │
  ╰─ Failed 1 changes(s) while evaluating the resource graph. See above for more details.

Personal assumption is that this is caused by Roblox's recent removal of api.roblox.com and www.roblox.com endpoints.

blake-mealey commented 2 years ago

Thanks for the report, that assumption makes sense. I'll take a look today

autonordev commented 2 years ago

Is there any update on this? @blake-mealey

blake-mealey commented 2 years ago

Haven't gotten to it yet, planning to look this weekend :)

blake-mealey commented 2 years ago

I tried to reproduce this and was not able to. Please try generating a log dump and uploading it here to help debug this by following this guide: https://github.com/blake-mealey/mantle/blob/main/LOG_DUMP.md

blake-mealey commented 2 years ago

I can also confirm it is unrelated to Roblox's recent deprecation announcement. I went through their announcement and documented how it affects Mantle here: https://github.com/blake-mealey/mantle/issues/144

autonordev commented 2 years ago

I identified the issue to be caused by the POST https://data.roblox.com/Data/Upload.ashx call, which attempts to submit the request but receives a 404

response '404 Not Found' for 
https://data.roblox.com/Data/Upload.ashx?assetId=8463110772

Oddly enough, I tested this on another group with a near-identical configuration file, with success on both initial creation and updates. Both are group games on two separate groups; the authenticated user (me), as verified via the logs, owns both groups.

This seems like a Roblox API issue rather than a mantle issue -- are you aware of any circumstance in which 404 returning for upload? The asset ID exists and is writable.

blake-mealey commented 2 years ago

Very weird. I have not seen anything like it before. Can you send me your config file?

autonordev commented 2 years ago

Here's the config file:


owner:
  group: 12639094
payments: owner

environments:
  - label: dev
    targetOverrides:
      places:
        start:
          configuration:
            name: Portford Development
      socialLinks: ~
  - label: staging
    targetOverrides:
      places:
        start:
          configuration:
            name: Portford Staging

target:
  experience:
    # icon
    # thumbnails
    configuration:
      genre: townAndCity
      playableDevices: [computer]
      playability: private
      privateServers: disabled
      enableStudioAccessToApis: true
      allowThirdPartySales: true
      allowThirdPartyTeleports: true
      avatarType: r6
    places:
      start:
        file: game.rbxlx
        configuration:
          description: Default description
          maxPlayerCount: 700
          serverFill: maximum
    socialLinks:
    - title: Test link
      url: https://discord.gg/abcdef
blake-mealey commented 2 years ago

I don't see anything wrong. I can verify that the group with that ID (https://www.roblox.com/groups/12639094/UK-United-Kingd-m#!/about) exists and owns the game with that ID (https://www.roblox.com/games/8463110772/Portford-Development) so I'm not sure why it's not working. You could try creating a ticket on the dev forum.

autonordev commented 2 years ago

Further investigation (including swapping out the group ID with a known working ID) shows that the issue is caused by the place file or something within the file specifically.

Given that this error appears to be with the Roblox API, I'll open a bug on the DevForum unless there's any possible issues or remedies you may know of.

blake-mealey commented 2 years ago

Reporting to Roblox is best at this point I think

autonordev commented 2 years ago

Checking the DevForum led me to this old bug report concerning the same API, where an Error 500 was returned for XML place files too large (above 89 MB), which falls into the criteria of the error-causing place file here (123 MB). I then tested this place file on Rojo and it successfully uploaded the 123 MB file.

Comparing how Rojo and Mantle internally upload places, they both use the same API endpoint but with one difference: Rojo sets the user agent as Roblox/WinInet whereas Mantle appears not to. I suspect the endpoint may treat requests from a Studio UA different to other agents. I attempted to tweak a local copy of Mantle to test this suspicion but I've not worked with Cargo, etc. before.

blake-mealey commented 2 years ago

Mantle does add the Roblox/WinInet UA header so that shouldn't be the issue. See: https://github.com/blake-mealey/mantle/blob/main/src/lib/roblox_api.rs#L641

blake-mealey commented 2 years ago

I took a look at Rojo's source and it looks like they are converting the place file to the binary format which will be a much smaller file before uploading it: https://github.com/rojo-rbx/rojo/blob/master/src/cli/upload.rs#L60

Mantle also supports uploading binary file formats. Try exporting your place as a .rbxl instead of a .rbxlx and see if it fixes the problem :)

autonordev commented 2 years ago

Yep, that's fixed it! Thanks for your help.