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

I got an error #317

Open
hieuttmatech opened this issue Dec 14, 2024 · 13 comments
Open

I got an error #317

hieuttmatech opened this issue Dec 14, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@hieuttmatech
Copy link

What happened?

I got an error when trying to download ipa from App Store:

ERR error="country code is invalid: country code mapping for store front () was not found" success=false
Please support me

Version

2.1.4

Relevant log output

No response

@hieuttmatech hieuttmatech added the bug Something isn't working label Dec 14, 2024
@ptzool
Copy link

ptzool commented Dec 15, 2024

@hieuttmatech I think there was a problem with the apple http response with the X-Set-Apple-Store-Front header. It gave me the same error, but now it returns the correct answer.

@ShaquilleOatmeal4444
Copy link

Hi, have just had the same error. @ptzool could you explain how you resolved this?

version 2.1.4

ipatool search app_name
ERR error="country code is invalid: country code mapping for store front () was not found" success=false

@hieuttmatech
Copy link
Author

@hieuttmatech I think there was a problem with the apple http response with the X-Set-Apple-Store-Front header. It gave me the same error, but now it returns the correct answer.

so, can you give me a solution ?

@ptzool
Copy link

ptzool commented Dec 18, 2024

Actually, I started by checking the code and verifying the request that ipatool makes to the apple servers.

I changed the logic of the countryCodeFromStoreFront function, and with that change I built a custom ipatool. (I don't think that was the solution.)

I logged in again with ipatool.

That's all I did.

➜  ipatool git:(main) ✗ ./ipatool --version
ipatool version dev
➜  ipatool git:(main) ✗ ./ipatool search facebook -l 1
9:21PM INF apps=[{"bundleID":"com.facebook.Facebook","id":284882215,"name":"Facebook","price":0,"version":"494.0.0"}] count=1


➜  ipatool git:(main) ✗ ipatool --version
ipatool version 2.1.4
➜  ipatool git:(main) ✗ ipatool search facebook -l 1
9:21PM INF apps=[{"bundleID":"com.facebook.Facebook","id":284882215,"name":"Facebook","price":0,"version":"494.0.0"}] count=1

@bigbrightgg
Copy link

Same problem here, re-login still give the same error.

@hieuttmatech
Copy link
Author

Actually, I started by checking the code and verifying the request that ipatool makes to the apple servers.

I changed the logic of the countryCodeFromStoreFront function, and with that change I built a custom ipatool. (I don't think that was the solution.)

I logged in again with ipatool.

That's all I did.

➜  ipatool git:(main) ✗ ./ipatool --version
ipatool version dev
➜  ipatool git:(main) ✗ ./ipatool search facebook -l 1
9:21PM INF apps=[{"bundleID":"com.facebook.Facebook","id":284882215,"name":"Facebook","price":0,"version":"494.0.0"}] count=1


➜  ipatool git:(main) ✗ ipatool --version
ipatool version 2.1.4
➜  ipatool git:(main) ✗ ipatool search facebook -l 1
9:21PM INF apps=[{"bundleID":"com.facebook.Facebook","id":284882215,"name":"Facebook","price":0,"version":"494.0.0"}] count=1

tks you. can you fix this bug and update new version. tks

@JaswantTeja
Copy link

Actually, I started by checking the code and verifying the request that ipatool makes to the apple servers.

I changed the logic of the countryCodeFromStoreFront function, and with that change I built a custom ipatool. (I don't think that was the solution.)

I logged in again with ipatool.

That's all I did.

➜  ipatool git:(main) ✗ ./ipatool --version
ipatool version dev
➜  ipatool git:(main) ✗ ./ipatool search facebook -l 1
9:21PM INF apps=[{"bundleID":"com.facebook.Facebook","id":284882215,"name":"Facebook","price":0,"version":"494.0.0"}] count=1


➜  ipatool git:(main) ✗ ipatool --version
ipatool version 2.1.4
➜  ipatool git:(main) ✗ ipatool search facebook -l 1
9:21PM INF apps=[{"bundleID":"com.facebook.Facebook","id":284882215,"name":"Facebook","price":0,"version":"494.0.0"}] count=1

hey, share the code change as a patch please.

@HerbeMalveillante
Copy link

Any news on this issue ? I'm encountering the same bug, version 2.1.4.

I'm in France btw, if that matters

@x1mdev
Copy link

x1mdev commented Jan 9, 2025

same issue here

@ptzool
Copy link

ptzool commented Jan 9, 2025

I have a workaround what I think solve the problem temporary.

Edit the Search function of following file pkg/appstore/appstore_search.go

func (t *appstore) Search(input SearchInput) (SearchOutput, error) {
	/*
		countryCode, err := countryCodeFromStoreFront(input.Account.StoreFront)
		if err != nil {
			return SearchOutput{}, fmt.Errorf("country code is invalid: %w", err)
		}
	*/

	countryCode := "HU"

	request := t.searchRequest(input.Term, countryCode, input.Limit)

	res, err := t.searchClient.Send(request)
	if err != nil {
		return SearchOutput{}, fmt.Errorf("request failed: %w", err)
	}

	if res.StatusCode != gohttp.StatusOK {
		return SearchOutput{}, NewErrorWithMetadata(errors.New("request failed"), res)
	}

	return SearchOutput{
		Count:   res.Data.Count,
		Results: res.Data.Results,
	}, nil
}

I added countryCode := "HU" with static value, and commented out the code above. (The value is the country code.)

countryCode, err := countryCodeFromStoreFront(input.Account.StoreFront)
if err != nil {
	return SearchOutput{}, fmt.Errorf("country code is invalid: %w", err)
}

Create a build, and check it please and give me feedback. THX

go build .
./ipatool search whatever

@dosentmatter
Copy link

dosentmatter commented Jan 9, 2025

It was failing for me with the same country code error so I built ipatool myself. Using the local build, I did ./ipatool auth revoke and then logged in again with ./ipatool auth login and it worked. It seems like if it's working, you should see email and name populated in ipatool auth info output. If it's empty, then it doesn't work.

Since the credentials are stored in keychain, ipatool from homebrew also sees the credentials from ipatool auth login and is able to search. However, it still fails with :37PM ERR error="received error: Sign In to the iTunes Store" success=false when trying to download. The ./ipatool I built is able to download though.

Not sure if above actually did anything or if it was just from retrying login. I retried login with homebrew ipatool multiple times but it didn't help. I didn't make any code changes.

@zhengxiaoUVic
Copy link

I’m encountering the same issue in version 2.1.4.

When I run ipatool auth info, it returns empty strings: INF email= name=" " success=true.

@mategorka
Copy link

This is just an observation as I needed a quick solution to the issue, but I got around this by manually modifying the password field in the keychain manager on macos by adding {"name":"added_name_here", ... ,"storefront":"insert_storefront_here_"} fixed it.

Found the storefront IDs here: https://gist.github.com/BrychanOdlum/2208578ba151d1d7c4edeeda15b4e9b1

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

No branches or pull requests

10 participants