ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.34k stars 177 forks source link

❌[ERROR] Invalid config file. Please contact the development team at support@proxyman.io. #2019

Closed aFernandezEspinosa closed 1 month ago

aFernandezEspinosa commented 1 month ago

Description

I'm getting a console error when trying to use CLI to import One single script. When Import the configs manually everything works as expected.

Steps to Reproduce

1.- Open Proxyman 2.- Go To Scripting 3.- Export one Script 4.- proxyman_scripting_tree_rules.config is generated 5.- use CLI to import the config into a new session 6.- Getting the following console output

Hello from the pygame community. https://www.pygame.org/contribute.html
🛠 [Import] Prepare for importing Proxyman Rules. Mode = override, input = proxyman_scripting_tree_rules.config
⚠️ You're using a Freemium version of Proxyman, which limits the number of rules. Please upgrade to the Premium version to import all rules.
❌[ERROR] Invalid config file. Please contact the development team at support@proxyman.io. 
The data couldn’t be read because it isn’t in the correct format.
Configuration has been successfully imported from proxyman_scripting_tree_rules.config with mode override.

Script is not showing into Proxyman Scripting as expected

Python

def import_proxyman_config(input_file_path, mode='override'):
    try:
        proxyman_cli_path = '/Applications/Proxyman.app/Contents/MacOS/proxyman-cli'
        command = [proxyman_cli_path, 'import', '--mode', mode, '--input', input_file_path]
        subprocess.run(command, check=True)
        print(f"Configuration has been successfully imported from {input_file_path} with mode {mode}.")
    except subprocess.CalledProcessError as e:
        print(f"An error occurred while importing the configuration: {e}")
    except Exception as e:
        print(f"An unexpected error occurred: {e}")

Current Behavior

Script is not being imported

Expected Behavior

Script should be imported

Environment

aFernandezEspinosa commented 1 month ago

I tried another run where I'm adding two different config files and the output is slightly different but none of the rules are being added to my Proxyman GUI

Hello from the pygame community. https://www.pygame.org/contribute.html
🛠 [Import] Prepare for importing Proxyman Rules. Mode = append, input = proxyman_ssl_proxying_rules.config
⚠️ You're using a Freemium version of Proxyman, which limits the number of rules. Please upgrade to the Premium version to import all rules.
✅ Import success!
Configuration has been successfully imported from proxyman_ssl_proxying_rules.config with mode append.
🛠 [Import] Prepare for importing Proxyman Rules. Mode = append, input = proxyman_scripting_tree_rules.config
⚠️ You're using a Freemium version of Proxyman, which limits the number of rules. Please upgrade to the Premium version to import all rules.
❌[ERROR] Invalid config file. Please contact the development team at support@proxyman.io. 
The data couldn’t be read because it isn’t in the correct format.
Configuration has been successfully imported from proxyman_scripting_tree_rules.config with mode append.
Proxyman has been opened successfully.

The script and SSL configs are not being added

Screenshot 2024-05-06 at 12 16 50 PM Screenshot 2024-05-06 at 12 16 41 PM
NghiaTranUIT commented 1 month ago

@aFernandezEspinosa I found the issue:

The Import from CLI is only able to import the export file, which is exported by the Exporter CLI (https://docs.proxyman.io/command-line#id-1.-export-proxyman-config)

# Export by CLI
$ /Applications/Proxyman.app/Contents/MacOS/proxyman-cli export -o ~/Desktop/data.json

If you manually export from the GUI, the CLI can't import it.

aFernandezEspinosa commented 1 month ago

That worked thanks @NghiaTranUIT