Flightplan: How to search a year of award inventory [no longer maintained]
#166
Original Poster
Join Date: Jan 2010
Posts: 189
I did manage to get flightplan installed on an Ubuntu VM. (Tip for anyone using Hyper-V quick create- don't select auto-login because you will have nightmares trying to get Enhanced Session to work correctly.) I was running into a little trouble installing node.js using the brew method (the linked article from Treehouse 4 years old) so I referenced method 3 here instead: https://www.ostechnix.com/install-node-js-linux/ . To get yarn installed correctly I had to remove the existing cmdtest package first. After installing yarn and flightplan, I had to go and add to before it would run.
Bug in the logger code, which I've pushed a fix for (0.2.7). It's only triggered when logging an exception, so I expect once you upgrade, you'll get a new error when running the server, but at least it'll be a more informative one
#169
Join Date: Apr 2018
Posts: 17
I'm getting an error, with BA (although I haven't tried others):
And I'm not sure if it's related, but on each of the detail windows when I click a day, has a broken image. I'd post but I don't have enough posts to put a URL
[BA] error Unexpected error occurred while searching!
TypeError: date.utcOffset is not a function
at module.exports.chooseDateTab (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/ba/engine.js:154:21)
at module.exports.modify (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/ba/engine.js:137:28)
at module.exports._modify (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/base/engine.js:186:17)
at module.exports._search (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/base/engine.js:142:22)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
TypeError: date.utcOffset is not a function
at module.exports.chooseDateTab (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/ba/engine.js:154:21)
at module.exports.modify (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/ba/engine.js:137:28)
at module.exports._modify (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/base/engine.js:186:17)
at module.exports._search (/home/myusername/.config/yarn/global/node_modules/flightplan-tool/src/base/engine.js:142:22)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
#170
Original Poster
Join Date: Jan 2010
Posts: 189
The broken image sounds like a BA website issue, not related to Flightplan at all.
Just pushed a new version (0.2.8) which includes a fix for that utcOffset error (as well as a few other bugs I found in the past week). Run "yarn global upgrade flightplan-tool" to install it.
Just pushed a new version (0.2.8) which includes a fix for that utcOffset error (as well as a few other bugs I found in the past week). Run "yarn global upgrade flightplan-tool" to install it.
#171
Join Date: Aug 2012
Posts: 165
I've got error with CX, seems economy only. No problem with business.
[CX] error Unexpected error occurred while searching!
TypeError: Cannot read property 'cabin' of undefined
at award.segments.f.segments.map.x (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\cx\parser.js:61:47)
at Array.map (<anonymous>)
at flights.map.f (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\cx\parser.js:39:30)
at Array.map (<anonymous>)
at module.exports.parse (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\cx\parser.js:35:28)
at module.exports._parse (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\base\parser.js:26:16)
at module.exports.parse (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\base\index.js:99:28)
at module.exports.search (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\base\index.js:70:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
[CX] error Unexpected error occurred while searching!
TypeError: Cannot read property 'cabin' of undefined
at award.segments.f.segments.map.x (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\cx\parser.js:61:47)
at Array.map (<anonymous>)
at flights.map.f (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\cx\parser.js:39:30)
at Array.map (<anonymous>)
at module.exports.parse (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\cx\parser.js:35:28)
at module.exports._parse (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\base\parser.js:26:16)
at module.exports.parse (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\base\index.js:99:28)
at module.exports.search (C:\Users\User04\AppData\Local\Yarn\Data\global\no de_modules\flightplan-tool\src\base\index.js:70:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
#172
Original Poster
Join Date: Jan 2010
Posts: 189
Thanks, must be a bug in the parser. If you have a specific route / date you searched for that caused the error, that would help. I've filed issues for both this, and the other issue reported above regarding NH waitlisted awards:
https://github.com/flightplan-tool/flightplan/issues/23
https://github.com/flightplan-tool/flightplan/issues/24
Will get a chance to fix these (and a few other engine-specific bugs I've been tracking) this week.
https://github.com/flightplan-tool/flightplan/issues/23
https://github.com/flightplan-tool/flightplan/issues/24
Will get a chance to fix these (and a few other engine-specific bugs I've been tracking) this week.
#173
Join Date: Jan 2012
Posts: 130
Hey guys -- I've been working on making docker images for this tool. It's been kind of an excuse for me to learn more about docker. I now have the command-line functioning. This should make it easier for those of you struggling with issues running it on Windows. I'll provide more documentation when this becomes "officially" a part of the Flightplan tool.
Install docker
Then you can run:
Chromium has a TON of dependencies so this isn't a lightweight image. But docker does heavy caching so it won't use any more space once the server and client dockers are ready. (and it's super easy for me to update.)
If you want to make this easy to launch in the future you can add this to your ~/.bash_aliases file:
Then you can run the command from anywhere using "fp"
Windows users should be able to create a similar bat file and add it to your path.
Let me know if anyone is able to test this out?
Install docker
Then you can run:
Code:
sudo '#if you need it' \ docker run \ --rm '#this removes the container after run' \ -it '#tell docker that we need to interact with it' \ -v ~/projects/fpdata/config/:/app/config '#-v indicates a volume mapping. host directory on the left' \ -v ~/projects/fpdata/data/:/app/data '#be sure to update all the mappings to where your local data is' \ -v ~/projects/fpdata/db/:/app/db \ '#don't touch the volumes on the right' rbosworth/flightplan:cli '#this will pull the image from docker hub' \ search --docker '#command to pass to flightplan -- you can use any of the cli commands'
If you want to make this easy to launch in the future you can add this to your ~/.bash_aliases file:
Code:
alias fp='sudo docker run --rm -it -v ~/projects/fpdata/config/:/app/config -v ~/projects/fpdata/data/:/app/data -v ~/projects/fpdata/db/:/app/db rbosworth/flightplan:cli '
Then you can run the command from anywhere using "fp"
Windows users should be able to create a similar bat file and add it to your path.
Let me know if anyone is able to test this out?
Last edited by wotan2525; Nov 5, 2018 at 10:52 pm
#174
Join Date: Jan 2012
Posts: 130
I also (in the process of making my last post) realized that I did something incredibly dumb that was preventing the server/client from working. That is now also functional. This one is a little bit different as it requires two docker containers that need to communicate with each other. This is easy, though (even easier than the command line) by using docker-compose.
Docker-compose is already installed with Windows and MAC versions of docker. For linux, instructions are here.
Use any text editor to create a docker-compose.yml with the following:
Edit the volumes to reflect your local storage. Your local files should be on the left (don't change those to the right of the colons.)
Save this file, navigate to the directory and type "sudo docker-compose up" -- you may not need sudo -- this will launch both client and server and link them. Then navigate your browser to http://localhost:3000 and you're in!
Docker-compose is already installed with Windows and MAC versions of docker. For linux, instructions are here.
Use any text editor to create a docker-compose.yml with the following:
Code:
version: '2' services: flightplanclient: image: rbosworth/flightplan:client container_name: flightplanclient ports: - '3000:3000' flightplanserver: image: rbosworth/flightplan:server container_name: flightplanserver ports: - '5000:5000' volumes: - ~/projects/fpdata/config:/app/config - ~/projects/fpdata/db:/app/db - ~/projects/fpdata/data:/app/data
Save this file, navigate to the directory and type "sudo docker-compose up" -- you may not need sudo -- this will launch both client and server and link them. Then navigate your browser to http://localhost:3000 and you're in!
#175
Original Poster
Join Date: Jan 2010
Posts: 189
Just a heads up: I've released a new version of Flightplan today (v0.3). It's a major internal refactoring, to cleanup some cruft and make the overall code base easier to hack on. Full API documentation has been written as well.
From an end-user perspective, everything should be the same as before (that's the hope at least!). There's also a few bug fixes for some websites, so if you were having problems feel free to upgrade and try it out. There are still a number of reported bugs I'm working my way through though (look for those to be fixed in a 0.3.1 release next week).
From an end-user perspective, everything should be the same as before (that's the hope at least!). There's also a few bug fixes for some websites, so if you were having problems feel free to upgrade and try it out. There are still a number of reported bugs I'm working my way through though (look for those to be fixed in a 0.3.1 release next week).
#178
Join Date: Jan 2012
Posts: 130
TypeError: searchStore.startDate.toISO is not a function
SearchForm.render
src/components/SearchForm.js:86
Code:
83 <label style={{ gridArea: 'startLabel' }}>Start Date</label> 84 <DatePicker 85 name='fromCity' > 86 selected={moment(searchStore.startDate.toISO())} 87 minDate={moment()} 88 maxDate={moment(searchStore.endDate.toISO())} 89 monthsShown={2}
#180
Join Date: Jan 2012
Posts: 130
Code:
flightplanclient Starting the development server... flightplanclient flightplanclient Failed to compile. flightplanclient flightplanclient ./src/components/SearchForm.js flightplanclient Line 91: 'DateTime' is not defined no-undef flightplanclient Line 102: 'DateTime' is not defined no-undef