fastlane / fastlane

๐Ÿš€ The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.66k stars 5.72k forks source link

[deliver] The provided entity includes an unknown relationship - 'prices' is not a relationship on the resource #21819

Open lakshydeep-14 opened 10 months ago

lakshydeep-14 commented 10 months ago

The provided entity includes an unknown attribute - 'availableInNewTerritories' is not an attribute on the resource 'apps' - /data/attributes/availableInNewTerritories The provided entity includes an unknown relationship - 'prices' is not a relationship on the resource 'apps' - /data/relationships/prices The provided entity includes an unknown relationship - 'availableTerritories' is not a relationship on the resource 'apps' - /data/relationships/availableTerritories

d3r3nic commented 10 months ago

Same Issue here:

A parameter has an invalid value - 'prices' is not a valid relationship name bundler: failed to load command: fastlane (/usr/local/lib/ruby/gems/3.0.0/bin/fastlane) /usr/local/lib/ruby/gems/3.0.0/bundler/gems/fastlane-4c9c094ac28d/spaceship/lib/spaceship/connect_api/api_client.rb:204:in `handle_response': \e[31m[!] A parameter has an invalid value - 'prices' is not a valid relationship name\e[0m (Spaceship::UnexpectedResponse)

Jinxiansen commented 10 months ago

Hi guys, We also got this error when upload ipa to AppStore. Does anyone know the root cause? This is urgent.

[14:00:23]: A parameter has an invalid value - 'prices' is not a valid relationship name
image
damirstuhec commented 10 months ago

Same here.

shashwatkn commented 10 months ago

Same here

Jinxiansen commented 10 months ago

Refer to this, upgrade your fastlane version to fix. https://github.com/fastlane/fastlane/issues/21125#issuecomment-1619162029

damirstuhec commented 10 months ago

@Jinxiansen thanks, updating to the latest version of fastlane indeed fixed the issue. ๐Ÿ‘

y-hakutaku commented 10 months ago

same here but resolved by new version 2.219.0. thanks @Jinxiansen

abhi-0213 commented 10 months ago

Why is this happening, i just wanted to send a build to review and i see this error, is this a bug from Fastlane?

gabma commented 10 months ago

Updating to 2.219.0 didn't solve the the provided entity includes an unknown attribute - 'availableInNewTerritories' issue for us, also mentioned here https://github.com/fastlane/fastlane/issues/21820

khvorost-dish commented 10 months ago

2.219.0 works for iOS but I have the following problem on tvOS with match:

Spaceship::UnexpectedResponse: [!] {
  "errors" : [ {
    "id" : "24207304-974a-43c6-8aab-757bccaf70a9",
    "status" : "400",
    "code" : "PARAMETER_ERROR.INVALID",
    "title" : "A parameter has an invalid value",
    "detail" : "A parameter 'filter[platform]' has an invalid value : 'Empty filter values are not supported.'",
    "source" : {
      "parameter" : "filter[platform]"
    }
  } ]
}
vveltri-parser commented 10 months ago

Same here.

douglascarvalho commented 10 months ago

Thanks folks, solved using the latest 2.219.0 version

But I also had to downgrade activesupport because it was throwing an error on pod install: deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator

Added in Gemfile to fix my problem:

gem 'activesupport', '~> 7.0.8'
jwaldrip commented 10 months ago

This is not working for me.

d3r3nic commented 10 months ago

I had fastlane in ios Gemfile like this: gem "fastlane", :git => "https://github.com/freddi-kit/fastlane.git", :branch => "altool-upload"

so i temporarily replaced it with gem "fastlane", "2.213.0"

and this successfully worked

isaac-weisberg commented 10 months ago

same

mickaeldanslenowhere commented 10 months ago

Get this one too : A parameter has an invalid value - 'prices' is not a valid relationship name Upgrading didn't fix the issue...

marcelojunior7 commented 10 months ago

Same here. We temporarily replaced it with gem "fastlane", "2.213.0" and this successfully worked for now

olympus-rajivmanivannan commented 10 months ago

Upgraded to 2.219.0 didn't fix the issue

isaac-weisberg commented 10 months ago

2.219.0 did work for me.

Foggzie commented 10 months ago

2.219.0 worked for us as well

TiBz0u commented 10 months ago

Our project was on version 2.212.0 and we add the "prices" error.

After this ticket and analysis at our side (we had two other projects on 2.214.0 & 2.217.0 with the same pipeline), we migrate from 2.212.0 to 2.217.0 and it works

Thanks everyone :)

misyobun commented 10 months ago

We also updated it to 2.219.0 and it worked.

pylapp commented 10 months ago

Followed in my side the comments about updating to at least 2.213.0, it works like a charm. Updated my Gemfile with a frozen version of Fastlane to be sure my CI/CD chain will use always the same version, then updated my Gemfile.lock. Maybe using the last release version will be better.

In Gemfile:

gem "fastlane", '2.213.0'

Then run:

bundle install
crsantos commented 10 months ago

2.219.0 didn't fix this and there's nothing related to this on release notes.

What I can see on the output is:

App has no prices yet... Enabling all countries in App Store Connect

and then:

The provided entity includes an unknown attribute - 'availableInNewTerritories' is not an attribute on the resource 'apps' - /data/attributes/availableInNewTerritories
The provided entity includes an unknown relationship - 'prices' is not a relationship on the resource 'apps' - /data/relationships/prices
The provided entity includes an unknown relationship - 'availableTerritories' is not a relationship on the resource 'apps' - /data/relationships/availableTerritories

I could trace this to this specific log here: https://github.com/fastlane/fastlane/blob/39ed6fed0c3cb8439238c4aec62384c59966931f/deliver/lib/deliver/upload_price_tier.rb#L28

And the error triggered starts here: https://github.com/fastlane/fastlane/blob/39ed6fed0c3cb8439238c4aec62384c59966931f/deliver/lib/deliver/upload_price_tier.rb#L38

Here's a full stacktrace:

failed to load command: fastlane (user-ruby-path/ruby/3.0.1/bin/fastlane)
user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/spaceship/lib/spaceship/connect_api/api_client.rb:223:in `handle_response': \e[31m[!] The provided entity includes an unknown attribute - 'availableInNewTerritories' is not an attribute on the resource 'apps' - /data/attributes/availableInNewTerritories (Spaceship::UnexpectedResponse)
The provided entity includes an unknown relationship - 'prices' is not a relationship on the resource 'apps' - /data/relationships/prices
The provided entity includes an unknown relationship - 'availableTerritories' is not a relationship on the resource 'apps' - /data/relationships/availableTerritories\e[0m
    from user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/spaceship/lib/spaceship/connect_api/api_client.rb:136:in `patch'
    from user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/spaceship/lib/spaceship/connect_api/tunes/tunes.rb:209:in `patch_app'
    from user-ruby-path/ruby/3.0.1/lib/ruby/3.0.0/forwardable.rb:238:in `patch_app'
    from user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/spaceship/lib/spaceship/connect_api/models/app.rb:109:in `update'
    from user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/deliver/lib/deliver/upload_price_tier.rb:38:in `upload'
    from user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/deliver/lib/deliver/runner.rb:161:in `upload_metadata'
    from user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/deliver/lib/deliver/runner.rb:61:in `run'
    from user-ruby-path/ruby/3.0.1/lib/ruby/gems/3.0.0/gems/fastlane-2.219.0/fastlane/lib/fastlane/actions/upload_to_app_store.rb:22:in `run'
bvanderplanck commented 9 months ago

It looks like those fields were already deprecated and they now basically fail.. (cf: https://developer.apple.com/documentation/appstoreconnectapi/app/relationships/availableterritories)

Screenshot 2024-01-23 at 10 39 45
bvanderplanck commented 9 months ago

So I have run some tests.. I have been able to get my app on the Apple Store using fastlane and modifying the source code as follow:

ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '109s/app_price_tier_id\: app_price_tier_id/app_price_tier_id\: nil/'
ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '109s/territory_ids\: territory_ids/territory_ids\: nil/'
ls ./deliver/lib/deliver/upload_price_tier.rb | head -1 | xargs sed -i -e '30d'
ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '50d'
ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '57d'
ls ./spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '58d'
qyzdo commented 9 months ago

Looks like release 2.212.2 fixes this problem https://github.com/fastlane/fastlane/releases/tag/2.212.2. https://github.com/fastlane/fastlane/pull/21187 Time to update (for me too ๐Ÿ˜„)

crsantos commented 9 months ago

Small correction to what @qyzdo mentioned:

2.212.0 doesn't solve the issue if you have price_tier on your Deliverfile.

as @gabma referred here https://github.com/fastlane/fastlane/issues/21820#issuecomment-1906892034, you can simply remove the price_tier 0 and you're good to go.

sunjinshuai commented 9 months ago

Same here.

foux commented 9 months ago

Same here. Allready on 2.219.0

jesusamaro25 commented 9 months ago

Same here, any solution? already on 2.219.0 version

foux commented 9 months ago

Absolutely none except removing the price

boldijar commented 9 months ago

Absolutely none except removing the price

What do you mean by removing the price? I have this issue and the app doesnโ€™t have a price, is free. Thank you.

owjsub commented 9 months ago

It is possible to submit an app for review as long as you do not specify a price_tier attribute on deliver. When price_tier is specified, fastlane calls app.update(attributes: attributes, app_price_tier_id: price_tier, territory_ids: territory_ids) which returns an error The provided entity includes an unknown relationship - 'availableTerritories' is not a relationship on the resource 'apps' - /data/relationships/availableTerritories.

While this workaround will help prevent errors with submitting an app, it's still not possible to manage the available territories through fastlane. As @bvanderplanck mentioned, the ASC API to manage territories were deprecated.

In App Store Connect, when modifying territories interactively, if you inspect the request, you will see a POST https://appstoreconnect.apple.com/iris/v1/bulkUpdateAppAvailabilities. In the App Store Connect docs, there appears to be a new way to manage territories, but it appears it's only for preorders? https://developer.apple.com/documentation/appstoreconnectapi/modify_the_territory_availabilty_for_an_app_pre-order

Should we open a new issue to fix the error that occurs when attempting to modify available territories in fastlane?

lacostej commented 8 months ago

So I have run some tests.. I have been able to get my app on the Apple Store using fastlane and modifying the source code as follow:

ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '109s/app_price_tier_id\: app_price_tier_id/app_price_tier_id\: nil/'
ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '109s/territory_ids\: territory_ids/territory_ids\: nil/'
ls ./deliver/lib/deliver/upload_price_tier.rb | head -1 | xargs sed -i -e '30d'
ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '50d'
ls ./spaceship/lib/spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '57d'
ls ./spaceship/connect_api/models/app.rb | head -1 | xargs sed -i -e '58d'

@bvanderplanck were these changes applied on top of 2.219.0 ? Do you want to send a PR?

lacostej commented 8 months ago

Also If someone could reproduce it while generating the debug output, that would be great.

DEBUG=y bundle exec fastlane ...

trevoriancox commented 7 months ago

This was working fine for me earlier this week. Now the errors cited in this issue are back. Tested with fastlane 2.220 and 2.217.0.

The provided entity includes an unknown attribute - 'availableInNewTerritories' is not an attribute on the resource 'apps' - /data/attributes/availableInNewTerritories
The provided entity includes an unknown relationship - 'prices' is not a relationship on the resource 'apps' - /data/relationships/prices
The provided entity includes an unknown relationship - 'availableTerritories' is not a relationship on the resource 'apps' - /data/relationships/availableTerritories
saifudheenvk commented 7 months ago

Facing the issue again in 2.220

azubala commented 7 months ago

In our case we faced error:

The provided entity includes an unknown attribute - 'availableInNewTerritories'

Removing price_tier: 0 from Deliverfile (as suggested here) helped -- it basically relies on the tier you have currently selected in AppStore Connect for your app.

trevoriancox commented 7 months ago

Removing price_tier: 0 from Deliverfile (as suggested [here]

And that's working for you now? I did that, it worked, and then the error came back. I do not have price_tier in my Deliverfile.

gemix95 commented 6 months ago

same here

pedro380085 commented 6 months ago

this issue continues

muhammad67uzair commented 4 months ago

I'm trying to update the app availability, through fastlane, but i get

It is possible to submit an app for review as long as you do not specify a price_tier attribute on deliver. When price_tier is specified, fastlane calls app.update(attributes: attributes, app_price_tier_id: price_tier, territory_ids: territory_ids) which returns an error The provided entity includes an unknown relationship - 'availableTerritories' is not a relationship on the resource 'apps' - /data/relationships/availableTerritories.

While this workaround will help prevent errors with submitting an app, it's still not possible to manage the available territories through fastlane. As @bvanderplanck mentioned, the ASC API to manage territories were deprecated.

In App Store Connect, when modifying territories interactively, if you inspect the request, you will see a POST https://appstoreconnect.apple.com/iris/v1/bulkUpdateAppAvailabilities. In the App Store Connect docs, there appears to be a new way to manage territories, but it appears it's only for preorders? https://developer.apple.com/documentation/appstoreconnectapi/modify_the_territory_availabilty_for_an_app_pre-order

Should we open a new issue to fix the error that occurs when attempting to modify available territories in fastlane?

is this still not fixed? is there still no way to update the app price tier and/or availability through fastlane?

neufeng commented 1 month ago

Same here. 2.212.2 work for me