simulationcraft / simc

Simulationcraft engine/GUI
GNU General Public License v3.0
1.4k stars 692 forks source link

Armory import fails built on latest Debian Testing packages #3628

Closed jcadduono closed 7 years ago

jcadduono commented 7 years ago

Importing characters from the armory is failing but only when building from sources. (prebuilt/nightly packages work) I could use some help debugging this if it is only happening for me.

It was working fine importing 2 days ago, and the only thing I had done since was apt-get dist-upgrade followed by a rebuild on latest simc git tag - however, it does not look like any packages upgraded were related to SimulationCraft building.

I have tried using both the default API key and my own armory API key and both give me the same results. (both also work fine on the Windows builds)

The web browser in SimC works perfectly fine.

Apt history:

Start-Date: 2017-03-14  13:39:20
Commandline: apt-get dist-upgrade
Requested-By: jc (1000)
Upgrade: libpangoft2-1.0-0:amd64 (1.40.3-3, 1.40.4-1), libmagick++-6.q16-7:amd64 (8:6.9.7.4+dfsg-1, 8:6.9.7.4+dfsg-2), irqbalance:amd64 (1.1.0-2.2, 1.1.0-2.3), xserver-xorg-video-nouveau:amd64 (1:1.0.13-1+b1, 1:1.0.13-2), xserver-common:amd64 (2:1.19.1-4, 2:1.19.2-1), vim-common:amd64 (2:8.0.0197-2, 2:8.0.0197-3), openjdk-8-jdk:amd64 (8u121-b13-3, 8u121-b13-4), openjdk-8-jre:amd64 (8u121-b13-3, 8u121-b13-4), xserver-xorg-core:amd64 (2:1.19.1-4, 2:1.19.2-1), imagemagick:amd64 (8:6.9.7.4+dfsg-1, 8:6.9.7.4+dfsg-2), libsqlite3-dev:amd64 (3.16.2-2, 3.16.2-3), libwbclient0:amd64 (2:4.5.4+dfsg-1, 2:4.5.5+dfsg-1), libsystemd0:amd64 (232-18, 232-19), libsqlite3-0:amd64 (3.16.2-2, 3.16.2-3), libmagickwand-6.q16-3:amd64 (8:6.9.7.4+dfsg-1, 8:6.9.7.4+dfsg-2), libjs-mathjax:amd64 (2.7.0-1, 2.7.0-2), fonts-mathjax:amd64 (2.7.0-1, 2.7.0-2), openssh-sftp-server:amd64 (1:7.4p1-6, 1:7.4p1-7), gir1.2-pango-1.0:amd64 (1.40.3-3, 1.40.4-1), udev:amd64 (232-18, 232-19), libudev1:amd64 (232-18, 232-19), openjdk-8-jdk-headless:amd64 (8u121-b13-3, 8u121-b13-4), samba-libs:amd64 (2:4.5.4+dfsg-1, 2:4.5.5+dfsg-1), libpangoxft-1.0-0:amd64 (1.40.3-3, 1.40.4-1), libinput-bin:amd64 (1.6.0-1, 1.6.2-1), libvte9:amd64 (1:0.28.2-5+b1, 1:0.28.2-5+b2), dpkg:amd64 (1.18.22, 1.18.23), imagemagick-6.q16:amd64 (8:6.9.7.4+dfsg-1, 8:6.9.7.4+dfsg-2), libpangocairo-1.0-0:amd64 (1.40.3-3, 1.40.4-1), systemd-sysv:amd64 (232-18, 232-19), libpam-systemd:amd64 (232-18, 232-19), systemd:amd64 (232-18, 232-19), xxd:amd64 (2:8.0.0197-2, 2:8.0.0197-3), openssh-server:amd64 (1:7.4p1-6, 1:7.4p1-7), libsmbclient:amd64 (2:4.5.4+dfsg-1, 2:4.5.5+dfsg-1), openssh-client:amd64 (1:7.4p1-6, 1:7.4p1-7), libmagickcore-6.q16-3:amd64 (8:6.9.7.4+dfsg-1, 8:6.9.7.4+dfsg-2), openjdk-8-jre-headless:amd64 (8u121-b13-3, 8u121-b13-4), vim-tiny:amd64 (2:8.0.0197-2, 2:8.0.0197-3), libmagickcore-6.q16-3-extra:amd64 (8:6.9.7.4+dfsg-1, 8:6.9.7.4+dfsg-2), libdpkg-perl:amd64 (1.18.22, 1.18.23), libpango-1.0-0:amd64 (1.40.3-3, 1.40.4-1), firefox-esr:amd64 (45.7.0esr-4, 45.8.0esr-1), libinput10:amd64 (1.6.0-1, 1.6.2-1), dpkg-dev:amd64 (1.18.22, 1.18.23), imagemagick-6-common:amd64 (8:6.9.7.4+dfsg-1, 8:6.9.7.4+dfsg-2)
End-Date: 2017-03-14  13:39:35

Start-Date: 2017-03-17  00:12:07
Commandline: apt-get dist-upgrade
Requested-By: jc (1000)
Upgrade: libmpc3:amd64 (1.0.3-1, 1.0.3-1+b2), libfontenc1:amd64 (1:1.1.3-1, 1:1.1.3-1+b2), libpopt0:amd64 (1.16-10, 1.16-10+b2), libcrystalhd3:amd64 (1:0.0~git20110715.fdd2f19-11+b1, 1:0.0~git20110715.fdd2f19-12), libxext-dev:amd64 (2:1.3.3-1, 2:1.3.3-1+b2), libwbclient0:amd64 (2:4.5.5+dfsg-1, 2:4.5.6+dfsg-1), libpciaccess0:amd64 (0.13.4-1, 0.13.4-1+b2), libxcursor1:amd64 (1:1.1.14-1+b1, 1:1.1.14-1+b4), libsm6:amd64 (2:1.2.2-1+b1, 2:1.2.2-1+b3), samba-libs:amd64 (2:4.5.5+dfsg-1, 2:4.5.6+dfsg-1), liblqr-1-0:amd64 (0.4.2-2, 0.4.2-2+b2), libexif12:amd64 (0.6.21-2, 0.6.21-2+b2), libxaw7:amd64 (2:1.0.13-1, 2:1.0.13-1+b2), libxvidcore4:amd64 (2:1.3.4-1, 2:1.3.4-1+b2), libxinerama1:amd64 (2:1.1.3-1+b1, 2:1.1.3-1+b3), libxft2:amd64 (2.3.2-1, 2.3.2-1+b2), libxxf86dga1:amd64 (2:1.1.4-1+b1, 2:1.1.4-1+b3), libsmbclient:amd64 (2:4.5.5+dfsg-1, 2:4.5.6+dfsg-1), libxxf86vm1:amd64 (1:1.1.4-1, 1:1.1.4-1+b2), libxdamage1:amd64 (1:1.1.4-2+b1, 1:1.1.4-2+b3), libxxf86vm-dev:amd64 (1:1.1.4-1, 1:1.1.4-1+b2), libexif-dev:amd64 (0.6.21-2, 0.6.21-2+b2), libxdamage-dev:amd64 (1:1.1.4-2+b1, 1:1.1.4-2+b3), synaptic:amd64 (0.84.1, 0.84.2), libxext6:amd64 (2:1.3.3-1, 2:1.3.3-1+b2), tzdata:amd64 (2016j-2, 2017a-1), liblzo2-2:amd64 (2.08-1.2, 2.08-1.2+b2)
End-Date: 2017-03-17  00:12:10

Simulationcraft Version

e410da430222f8afbbc4808a49f8f74d4de6dae3

Reproduction Steps:

Build on Debian Testing: Using Qt version 5.7.1 in /usr/lib/x86_64-linux-gnu

SimulationCraft encountered an error!

All options used for simulation:

### Begin GUI options ###
ptr=0
item_db_source=local/bcpapi/wowhead/ptrhead
target_error=0
iterations=250000
default_world_lag=0.05
max_time=300
vary_combat_length=0.2
fight_style=LightMovement
tmi_window_global=6
target_level+=3
target_race=Humanoid
default_skill=1.0
optimal_raid=0
override.bloodlust=1
override.bleeding=1
override.mortal_wounds=1
threads=4
process_priority=Low
calculate_scale_factors=1
scale_only=agi,ap,crit,haste,mastery,vers,wdps,wohdps,runspeed
statistics_level=1
### End GUI options ###
### Begin simulateText ###
# Profile will be downloaded into a new tab.
#
# Clicking Simulate will create a simc_gui.simc profile for review.

# Unable to generate profile from: http://us.battle.net/wow/en/character/mal'ganis/Firearm/advanced

# BCP API: Unable to download player from 'http://us.battle.net/api/wow/character/mal'ganis/Firearm?fields=talents,items,professions&locale=en_US', JSON parse error
# If you built this from source, remember to add your own api key.
# Unable to parse XML input: unexpected end of data
# BCP API (html): Unable to download player from 'http://us.battle.net/wow/en/character/mal'ganis/Firearm/advanced', invalid profile

### End simulateText ###
desired_targets=2
### Begin overrides ###
# User-specified persistent global and player parameters will be set here.

### End overrides ###
### Begin final options ###
### End final options ###
### END ###
jcadduono commented 7 years ago

Built on a separate PC with similar hardware and same OS and can't reproduce this. Very odd.

scamille commented 7 years ago

https://github.com/simulationcraft/simc/wiki/HowToBuild#building-simulationcraft-on-linux

@navv1234 Does the GUI requires build-essential and libssl-dev as well?

navv1234 commented 7 years ago

You cannot compile anything without build-essential (or whatever compiler chain you want) on debian-ish distros, so sure. Libssl-dev is needed, and keep in mind that qmake needs to be invoked with CONFIG+=openssl. Otherwise the armory import (which is done by the engine, not the gui) will fail, since no https available. Nothing has changed in this regard for a very long time, and those instructions probably could use some updating.

jcadduono commented 7 years ago

I was able to get it to import now with CONFIG+=openssl and this commit: https://github.com/jcadduono/simc/commit/9c91e6df6b349fd75cd2c4ef15d954e1879aeb02

ATM if you don't specify OPENSSL_LIBS in the qmake line then it loses the -l after that hence the defined check added. If you're building with system qt then you probably require system ssl libs as well. Not sure what -lssleay32 was about, I guess that's for windows cross-compile?

navv1234 commented 7 years ago

Yeah, ssleay32 is windows stuff, I'll figure the qmake projects out when I have a bit of time.

I'll fix this in simcqt.pro too, but personally, anything related to qmake for me is done through the (new-ish) simulationcraft.pro qmake project.

jcadduono commented 7 years ago

Since some have been asking me why it still fails, I'll also add to this post that you need to add a Blizzard API key to SimulationCraft for it to be able to access the armory API and retrieve traits.

You also need to make sure you have the correct libssl development files for your operating system's Qt and OpenSSL version. At the moment, Qt 5.7.1 is using libssl1.0-dev + libssl1.0.2 (OpenSSL 1.0.2) NOT libssl-dev + libssl1.1 (OpenSSL 1.1) I am not 100% sure that Qt is the reason OpenSSL 1.1 isn't working correctly for me since I haven't read that part of the source code, so that's just a hunch.

See https://github.com/simulationcraft/simc/wiki/BattleArmoryAPI for instructions on getting an API key. SimulationCraft is supposed to be able to read the API key from either apikey.txt in its folder, or ~/.simc_apikey or from the Armory API key textbox in the GUI. From my testing, none of these approaches are working and it just reads it as blank if they exist. You can embed your own key inside the build by using: qmake simcqt.pro CONFIG+=openssl SC_DEFAULT_APIKEY=yourapikeyhere The Armory API key textbox must be empty for it to work.

navv1234 commented 7 years ago

I made ssleay stuff windows only and conditionalized (hopefully) the variable checks, it should work fine now.

navv1234 commented 7 years ago

Should be fixed now, closing.